This plugin helps you to generate a directory structure of a project, makes document more clear, and easy to edit and update.
.
βββ dist
βββ src
β βββ css
β βββ js
βββ server.js
βββ package.json
Open sublime, go to Preferences -> Browse packages..., and download dirstructure to this directory:
git clone git@github.com:JeremyFan/sublime-dirstructure.git
Go to Preferences -> Key Bindings, and config a shortcut you like, for example ctrl + shift + d:
{
"keys": ["ctrl+shift+d"],
"command": "dir_structure"
}
Just write the file name or folder name of the project, for example:
src
server.js
package.json
Selected these lines, and press ctrl + shift + d (or other shortcut you config),
then dirstructure generates:
.
βββ src
βββ server.js
βββ package.json
Use brackets(()) for sub directory, and split them with a comma(,), for example:
dist
public(logos,fonts)
src(css,js(libs,api(index.js)),images)
server.js
package.json
dirstructure generates:
.
βββ dist
βββ public
β βββ logos
β βββ fonts
βββ src
β βββ css
β βββ js
β β βββ libs
β β βββ api
β β βββ index.js
β βββ images
βββ server.js
βββ package.json
You can nests any level of folder.
If you want add some explain for a file or a folder, use sharp(#), for example:
dist#after build
public(logos,fonts)
src#source code(css,js(libs,api#api module(index.js)),images)
server.js
package.json
webpack.config.js#webpack config
dirstructure generates:
.
βββ dist Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β· after build
βββ public
β βββ logos
β βββ fonts
βββ src Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β· source code
β βββ css
β βββ js
β β βββ libs
β β βββ api Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β· api module
β β βββ index.js
β βββ images
βββ server.js
βββ package.json
βββ webpack.config.js Β·Β·Β·Β·Β·Β·Β· webpack config
Looks good, auto align for the comment text.
Most of developers like use markdown to write documents for a project. If use this plugin to manager the description of directory structure, I recommend to reserve the raw code, in order to edit and generate next time.
For example, I use <!-- --> to comment and hide the raw code in document. When directory changes, I generate a new directory structure by raw code instead of the old one.