‘I will take the Ring,’ he said, ‘though I do not know the way.’ J.R.R Tolkien
Atom plugin for operating with group of related files as single file (open, switch, close, create). You can open files in split view and easily navigate around all fellows.
- Open related files in split view
- Synchronous tab switch
- Synchronous tab close
- Config for switch and close only with first file
- Option for vertical side-by-side split view
- Option to create files if they do not exist
Using apm
:
apm install atom-fellowship
Or search for atom-fellowship
in Atom settings view.
This plugin useless without configuration.
For configuring fellows you need to provide array with 3 (or more. See below) values:
- String with Regex. Used to much needed file.
- String for replace. Used to replace path in files. As usual this is folders names.
- String for replace. Most cases this is some namespace. As usual this is file extension or namespace.
Configuration for simple header-source project structure
./inc/file.h
./src/file.c
will be like this:
.*inc.*.h, .h
.*src.*.c, .c
Configuration for simple MVC project structure
./project/controllers/file.js
./project/views/file.xml
./project/styles/file.css
will be like this:
.*controllers.*.js, /controllers/, .js
.*views.*.xml, /views/, .xml
.*styles.*.css, /styles/, .css
./lib/controllers/ns-file.js
./prj/controllers/_file.js
./prj/views/_file.js
Configuration:
.*lib\/controllers/.*.js, lib/controllers/, _ns-
.*prj\/controllers/.*.js, prj/controllers/, _
.*prj\/views.*.js, prj/views/, _
./lib/controllers/foo-file.js
./prj/controllers/bar-file.js
./prj/styles/baz-file.css
Configuration:
.*lib\/controllers/.*.js, lib/controllers/, foo-, .js
.*prj\/controllers/.*.js, prj/controllers/, bar-, .js
.*prj\/styles.*.css, prj/styles/, baz-, .css
Check your config by opening Application: Open your config
for any cases.
If you need you can add more than 3 fellows via your config.cson
. But not more than 9 because this is limitation of Fellowship of the Ring!
fellow1: [
".*lib\\/controllers/.*.js"
"lib/controllers/ns-"
"foo-"
".js"
]
fellow2: [
".*prj\\/controllers/.*.js"
"prj/controllers/"
"bar-"
".js"
]
fellow3: [
".*prj\\/styles.*.css"
"prj/styles/"
"baz-"
".css"
]
fellow4: [
".*prj\\/views.*.xml"
"prj/views/"
"waldo-"
".xml"
]
Seriously you could not comfortably work more with 4 splitted views.
You can provide more than 3 replace strings (unlimited potentially), but probably you don't need that.
Please note that Windows FS paths should be like this:
In Atom config:
*some\\path*.scss
some\replace
In cson should be:
".*some\\\\path.*.scss"
"some\\replace"
"_ns-"
This plugin cannot cover cases where:
- obviously plugin can match only files with same part in the name
- one fellow has namespace and other don't have one. Because
""
cannot replace"ns-"
. Plugin will work only on namespaced files, and you can use settings to somehow work with this
- Press
shift-alt-F
to load plugin and open all related files orshift-alt-C
to create fellows - Close first pane file to close all related files
- Switch first pane files to switch all fellows
splitHoriz:false
side by side layoutonlyFirstCloseOthers:true
only first fellow close othersonlyFirstSwitchOthers:false
only first fellow switch othersopenEvenIfNotExist:false
create fellows if they not exist on open
atom-fellowship:openFellows
, default shift-alt-F
: load plugin and open all related files
atom-fellowship:createFellows
, default shift-alt-C
: load plugin, open all related files and create if someone not exist
Any help is welcome 🙏
MIT © Dima Nechepurenko