Skip to content

JeremyFan/sublime-dirstructure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Sublime-DirStructure

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

Install

Open sublime, go to Preferences -> Browse packages..., and download dirstructure to this directory:

git clone git@github.com:JeremyFan/sublime-dirstructure.git

Config

Go to Preferences -> Key Bindings, and config a shortcut you like, for example ctrl + shift + d:

{
  "keys": ["ctrl+shift+d"],
  "command": "dir_structure"
}

Using

Basic

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

Sub Directory

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.

Comment

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.

Write Documents

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.

About

This plugin helps you to generate a directory structure of a project.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages