Automate File Tree Generation
Marketplace link
How to use
- Right click on file explorer and then
Generate File Tree , name it, that's it!
Custom configuration
Follow these steps to create your custom configuration:
Open Settings menu through Preferences > Settings OR Command + ,
Search for filetreegenerator and click on Edit in settings.json link under filetreegenerator option.
Inside settings.json type in filetreegenerator.files and hit enter. The default file configuration array will be automatically displayed.
Add/Remove objects from the filetreegenerator.files array.
Example
"filetreegenerator.directory" : "Pn$",
"filetreegenerator.files" : [
{
"fileName": "Pn$.tsx",
"content": "\r\nimport {FC, ReactNode} from 'react';\r\nimport classes from './Pn$.module.scss';\r\nimport classNames from 'classnames/bind';\r\n\r\n\r\nconst cx = classNames.bind(classes);\r\n\r\nexport const Cn$: FC<ICn$> = ({children}: ICn$) => {\r\n return (\r\n <div className={cx({'fn$': true})}>\r\n {children}\r\n </div>\r\n );\r\n};\r\n\r\nexport interface ICn$ {\r\n children?: ReactNode;\r\n}\n"
},
{
"fileName": "Pn$.module.scss",
"content": "\r\n.kn$ {\r\n \r\n}\n"
}
]
You can easily create a template from an existing file, just by:
- open
find & replace by pressing cmd + r
- press
ctrl + enter on find field
- replace with
'\r\n'
- That's it!
Entered name replacement keywords:
fn$ entered name
cN$ camelCase
cn$ camelCase
Cn$ PascalCase
Pn$ PascalCase
pn$ PascalCase
kn$ kebab-case
sn$ snake_case
Kn$ SCREAMING-KEBAB-CASE
Sn$ SCREAMING_SNAKE_CASE
| |