All Projects → aprilandjan → vscode-ascii-tree-generator

aprilandjan / vscode-ascii-tree-generator

Licence: MIT license
Generate ASCII tree of directories or format selected text into its corresponding "tree string" representation.

Programming Languages

typescript
32286 projects
HTML
75241 projects
javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to vscode-ascii-tree-generator

yii2-highlight
Yii2 Highlight.js extension
Stars: ✭ 14 (-60%)
Mutual labels:  extension
FOF3-Basic
A hello world type example for Akeeba F0F3 as a walkthrough for building a Joomla! component from the ground up.
Stars: ✭ 14 (-60%)
Mutual labels:  extension
kanboard chrome extension
Kanboard Chrome Extension
Stars: ✭ 13 (-62.86%)
Mutual labels:  extension
VscOdooSnippets
Odoo Snippets for Visual Studio Code
Stars: ✭ 29 (-17.14%)
Mutual labels:  extension
Line-Clipper
💻Efficient navigation between browser and IDE while working on GitHub.
Stars: ✭ 64 (+82.86%)
Mutual labels:  extension
block-site
Chrome extension that blocks access to distracting websites to improve your productivity.
Stars: ✭ 81 (+131.43%)
Mutual labels:  extension
qzone helper
QQ空间助手,批量删除,导出说说/留言/日志/相册 浏览器插件和脚本
Stars: ✭ 36 (+2.86%)
Mutual labels:  extension
sqlops-widgets
SQL Operations Studio Dashboard Widgets - including Always ON
Stars: ✭ 22 (-37.14%)
Mutual labels:  extension
SwiftMan
Swift extensions and utils classes
Stars: ✭ 31 (-11.43%)
Mutual labels:  extension
hypergravity
Gravity simulation in Hyper terminal
Stars: ✭ 22 (-37.14%)
Mutual labels:  extension
httpz
Fat-free hardenable opportunistic encryption for Firefox
Stars: ✭ 60 (+71.43%)
Mutual labels:  extension
Netlify
A VS Code extension that displays your Netlify build statuses and more!
Stars: ✭ 23 (-34.29%)
Mutual labels:  extension
wulaphp
一个有点复杂的PHP框架!
Stars: ✭ 26 (-25.71%)
Mutual labels:  extension
sqlite-gui
Lightweight SQLite editor for Windows
Stars: ✭ 151 (+331.43%)
Mutual labels:  extension
clever-vscode
Clever help to put vscode to the next level
Stars: ✭ 17 (-51.43%)
Mutual labels:  extension
DarkCloud
SoundCloud Dark Theme
Stars: ✭ 52 (+48.57%)
Mutual labels:  extension
sqlite-spellfix
Loadable spellfix1 extension for sqlite as python package
Stars: ✭ 13 (-62.86%)
Mutual labels:  extension
burp-ntlm-challenge-decoder
Burp extension to decode NTLM SSP headers and extract domain/host information
Stars: ✭ 28 (-20%)
Mutual labels:  extension
solidus static content
📄 Content management for your Solidus store.
Stars: ✭ 18 (-48.57%)
Mutual labels:  extension
Flask-GraphQL-Auth
(UNMAINTAINED. FEEL FREE TO FORK) 🐍A Pythonic way to provide JWT authentication for Flask-GraphQL
Stars: ✭ 64 (+82.86%)
Mutual labels:  extension

VSCode ASCII Tree Generator

Build Status Download Count Download Count

Generate ASCII tree of directories or format selected text into its corresponding "tree string" representation.

Usage

Generate ASCII "tree strings" for any directory in the workspace explorer. Aside from that, you can also select pre-formatted text in the explorer and format it to its corresponding "tree string" easily.

Format Selected Text to Tree String

Using the # (octothorpe/hash) character, you can specify the depth of the current element. After writing a few lines (see example below), select the targetted pre-formatted lines, right-click on the highlighted text selection, and click Format to Tree String menu option. This will replace the selected, pre-formatted text, into its corresponding "tree string" representation.

Format Text to Tree String

For clarity, each line of your target tree structure should begin with at least a single # (octothorpe/hash) character. At most, each line can only have one more additional # than any line above it. This will ensure proper formatting. By placing multiple # symbols, it is possible to designate the depth of a certain element.

Demonstration

Pre-Formatted Tree String

# public
# dist
## index.d.ts
## index.js
# src
## index.ts

Formatted Tree String

.
├── public
├── dist
│   ├── index.d.ts
│   └── index.js
└── src
  └── index.ts

Addendum

In cases where you would like to undo the formatting operation, simply use VSCode's editor undo option (EditUndo). You can optionally use the keybindings for undo as well (+Z on Mac or CTRL+Z on Windows). However, this option will fail in cases where the undo operation is invalid (e.g. text inside downloaded materials).

In all cases, you can revert formatting tree strings back to their preformatted versions by selecting the formatted tree string, heading to the VSCode Command Pallete (+SHIFT+P on Mac or CTRL+SHIFT+P on Windows), and executing Revert Tree String to Text. As long as the matching lines up, this should provide back your intended pre-formatted tree string.

Generate Tree String for Directory

In addition to being able to format pre-formatted tree strings, you may also generate tree strings for directories inside your current workspace (directories appearing in Explorer tab). To do so, right-click on any directory, or empty space, within the Explorer tab and select the Generate Tree String for Directory menu option. An example is shown below.

Generate Tree String for Directory

Addendum

The walking process through files is performed asynchronously. Therefore, selecting heavily-nested folders (e.g. node_modules) will directly affect performance speed.

By default, node_modules and .git are ignored while generating tree string for directories. However, this can be customized by setting asciiTreeGenerator.directoryIgnore in configurations. Also, setting asciiTreeGenerator.directoryMaxDepth can limit the depth of directory walking-through.

Configuration

Each tree string character can be defined by its ASCII code representation (UTF character code, more generally). As such, the theorectical range for character codes is 0 to 65535 (two bytes). However, and important to note, is that not every character code is printable and/or may cause formatting issues.

The available parameters are:

Property (Setting) Name Default Character Code Default Character Description
asciiTreeGenerator.rootElement 46 . For root elements
asciiTreeGenerator.parentElement 9474 For vertical parent elements
asciiTreeGenerator.childElement 9500 For child elements
asciiTreeGenerator.lastElement 9492 For last elements of paths
asciiTreeGenerator.dashElement 9472 For horizontal dash elements
asciiTreeGenerator.blankElement 32 For blank / space elements

Sample Configurations

Commonly used configurations that you can manually enable by entering the values for each of the aforementioned property names above (perfom these changes inside a settings.json file).

Configuration Root Parent Child Last Dash Blank
Default 46 . 9474 9500 9492 9472 32
Double Line 9559 9553 9568 9562 9552 32
Classic 43 + 124 | 124 | 43 + 45 - 32
Classic Rounded 43 + 124 | 124 | 96 ` 45 - 32
Exclamation Marks 35 # 33 ! 35 # 42 * 61 = 32

Issues and Contribution

Please feel free to submit any issues or bugs you find with the extension. More generally, please reach out if you have any questions on how to use the extension.

Finally, contribution or ideas are humbly welcomed so please check us out on GitHub :) !

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].