=== Whale Dividers ===
Create in-code dividers from shortcuts; helpful for sectioning code, making debug outputs more readable, or making your documentation look ✨pretty✨.
Whale Dividers turns quick shortcuts into full code snippets, with dynamic syntax adjustment based on the active programming language.
Dynamic snippet support for
C · C++ · C# · Go
Java · JavaScript · JSX
LaTeX · Lua · Perl · PHP · PowerShell · Python
R · Ruby · Rust · Swift · TypeScript
Many more...
Usage
To create a whale divider, type a shortcut — for instance, ## — and press enter to expand.
To force expansion of a shortcut, press Ctrl/Cmd + Space at the end of the shortcut.
By specifying a type flag, you can have the whale divider autofill into a print statement (or other stdout) or a single-line comment; the extension detects the current programming language and selects the correct syntax automatically.
[type][width]#[content]#
|
[type] |
[width] |
# |
[content] |
# |
| Format |
print
comment |
Any integer between 1 and 72 |
|
Any text to use as divider title |
|
Default (if left blank) |
Plaintext divider |
Default width (20) |
|
Unbroken divider with no title |
|
|
|
|
|
|
|
Examples
Below are some examples of shortcuts, and what snippets they would expand to (note, format for p- and c-type snippets is language-dependent):
| Shortcut |
Expanded Snippet |
## |
→ ==================== |
p## |
→ console.log("====================") |
4## |
→ ==== |
#Hello# |
→ === Hello, World === |
c9#Hey# |
→ /*== Hey ==*/ |
p7#🙋♂️# |
→ print("== 🙋♂️ ==") |
Configuration
Whale dividers is highly customisable, with the following configuration options:
- Default Width [Default: 20]
- Divider width when not specified in shortcut
- Space Comments [Default: true]
- Whether to add space between divider and comment tags for
comment-type whale dividers
- On:
\* ==== *\ Off: \*====*\
- Space Title [Default: true]
- Whether to add space between text and divider characters for whale dividers with titles
- On:
== Lorem Ipsum == Off: ==Lorem Ipsum==
- Always Whale [Default: true]
- If the text for a divider is longer than the divider length, whether to add divider characters on the sides anyway
- On:
3#abc# → =abc= Off: 3#abc# → abc
- Shorter Tail [Default: true]
- If there would be an uneven number of divider characters on each side of a title, whether to make the right-hand side (the tail) the shorter side
- On:
==abc= Off: =abc==
- Shorter Tail [Default: true]
- If there would be an uneven number of divider characters on each side of a title, whether to make the right-hand side (the tail) the shorter side
- On:
==abc= Off: =abc==
- Whale Character [Default: '=']
- The symbol used to construct whale dividers
Advanced Configuration (altering not recommended) :
- Control Character [Default: '#']
- The symbol used to delimit whale divider shortcuts
- Max Width [Default: 72]
- The maximum width of a whale divider
- Snippet Text Parser [Default: 'unicode']
- The parser used for reading the text that forms divider titles
Why 'Whale'?
I use these dividers a lot in my code to mark out sections or make output easier to read. My partner once saw one of these dividers on my screen and remarked how it looked like a little whale; hence, whale dividers.
print('====') ← The Original Whale
Release Notes
See CHANGELOG.md