Skip to content

Instantly share code, notes, and snippets.

@roman-balzer
Created February 25, 2024 02:11
Show Gist options
  • Save roman-balzer/b345a084dcd0c0fbd7b3bc6855d77e86 to your computer and use it in GitHub Desktop.
Save roman-balzer/b345a084dcd0c0fbd7b3bc6855d77e86 to your computer and use it in GitHub Desktop.
Obsidian - Cheatsheet Example with summarized CSS
/* --- Multi-Column Callout --- from MCL --- */
.callout[data-callout="multi-column"] {
--callout-min-width: 200px;
--callout-gap: 0.5rem;
display: flex;
flex-wrap: wrap;
gap: var(--callout-gap);
background: unset;
border: unset;
margin: unset !important;
padding: unset !important;
clear: both;
& > .callout-title { display: none; }
& > .callout-content { display: contents; width: 100%; }
& > .callout-content > *:is(div,ul,blockquote) { flex: 1 1 var(--callout-min-width); }
}
/* Non-Minimal-Themes: Gap between callouts */
/* .callout.callout.callout:not(:last-child) { margin-bottom: 10px; } */
/* --- Blank Callout --- from MCL --- */
div[data-callout*="blank"].callout {
margin: 0 !important;
padding: 0 !important;
border: 0;
background: unset;
box-shadow: unset;
& > .callout-title { display: none; }
& > .callout-content { display: contents; }
}
/* fixed width for icon column */
[data-callout-metadata*="mw50"] { max-width: 50px; }
.callout.callout.callout {
padding: 12px;
& .callout-title { margin-inline-start: 0px; }
& p { margin: 0; }
& blockquote { padding: 0; margin: 0; }
}
/* Reduce Callout padding */
.callouts-outlined .cm-embed-block.cm-callout { padding-top: 10px; }
/* No left borders on blockquotes */
.markdown-rendered blockquote { border-left: 0; }
/* --------------- ALIGN TABLE in callout --------------- */
.callout > .callout-content:has( > blockquote > table) { margin: -6px -12px -12px -12px; }
.callout > .callout-content {
& > blockquote > table { width: 100%; }
& tr :is(td,th):first-child { padding-left: 5px !important; }
& tr :is(td,th):last-child { padding-right: 5px !important; }
& :is(td,th) { border-color: rgba(var(--callout-color), 0.2) !important; }
}
/* --------------- HIDE EMPTY LINE BETWEEN CALLOUTS ---------------*/
.is-live-preview .cm-callout:not(.cm-active) + .cm-line:not(.cm-active):has(br) + .cm-callout:not(.cm-active) {
margin-top: -20px !important;
}
/* --------------- GROUPING of TABLE ROWS --------------- */
tr:has(td > .block) td {
padding-block: 2px !important;
border-block: 0 !important;
}
tr:has(td > .block-start) td {
padding-block: 5px 2px !important;
border-block-end: 0 !important;
}
tr:has(td > .block-end) td {
padding-block: 2px 5px !important;
border-block-start: 0 !important;
}
/* --------------- KEYBOARD KEY styling --------------- */
kbd {
--_kbd-bg: var(--kbd-bg, hsl(222.86deg 3.06% 55.1%));
--_kbd-text: var(--kbd-text, hsl(220deg 4.23% 13.92%));
--_kbd-border: var(--kbd-border, hsl(228deg 3.94% 24.9%));
margin: 0px 0.1em;
padding: 0 5px;
border-radius: 3px;
min-width: 25px;
display: inline-block;
text-align: center;
font-family: Arial,Helvetica,sans-serif;
font-size: 0.8rem;
border-width: 1px 3px 4px 2px;
border-style: solid;
background-color: var(--_kbd-bg);
color: var(--_kbd-text);
border-color: var(--_kbd-border);
&.tint {
--tint-percentage: 85%;
background-color: color-mix(in hsl, var(--_kbd-bg), var(--tint-bg) var(--tint-percentage));
color: color-mix(in hsl, var(--_kbd-text), var(--tint-text) var(--tint-percentage));
border-color: color-mix(in hsl, var(--_kbd-border), var(--tint-base) var(--tint-percentage));
}
&.placeholder {
opacity: 0.3;
min-width: 40px;
}
}
/* --------------- TINT example --------------- */
/* Usage for example <kbd class="tint purple">Enter</kbd>*/
.tint:is(i,b,em,strong,span) { color: var(--tint-base); }
:is(.purple, .Purple) {
--tint-base: hsl(271, 43%, 51%);
--tint-bg: hsl(271, 48%, 21%);
--tint-text: hsl(267, 52%, 75%);
}
/* ----------------- Callout Chroma overrides ----------------------------------- */
/* overrides the color of callout/bold/italics with --callout-color
* Usage: > [!callout|vscode chroma]
*/
.callout[data-callout-metadata~=chroma] {
--override-accent: rgb(var(--callout-color));
--bold-color: var(--override-accent);
--italic-color: var(--override-accent);
}
[data-callout-metadata~=obsidian] { --callout-color: 149,105,235; }
[data-callout-metadata~=spotify] { --callout-color: 30, 215,96; }
[data-callout-metadata~=discord] { --callout-color: 88, 101,242; }
[data-callout-metadata~=vimium] { --callout-color: 72, 137,244; }
[data-callout-metadata~=windows] { --callout-color: 0, 188,212; }
[data-callout-metadata~=vscode] { --callout-color: 31, 156,240; }
parent
[[Unspecified]]

[!attention] This cheatsheet is supposed to be used with a dedicated css file (summary.cheatsheet.css). Also keep in mind that Shortcuts marked with 🔹are not the default shortcuts, but those I changed them to for my personal use. The mark behind 🔹shows the default keybindings. Please look up default shortcuts if needed. The cheatsheet is optimize for use with Minimal theme. If interested, I also have cheatsheets for Obsidian, Discord, Vimium, Spotify and Windows Legend: 🔹Non-default keybinding changed by me 🔸Keybind of a plugin 🔻Changed keybind conflicts with a default keybind Contact: If you have more questions on this, ping me in the Obsidian Discord server or DM me on Discord (Username: _azael)

[!multi-column]

[!blank-container|mw50] ![[Pasted image 20240222014021.png]]

VSCode

[!multi-column]

[!kbd|vscode chroma] General

Shift + Alt + . Auto fix
Ctrl + . Quick fix
Ctrl + Shift + R Refactor
Ctrl + Shift + P Commands
Ctrl + Space Trigger suggest
Ctrl + K > I Show hover

[!kbd|vscode chroma] Terminal

Ctrl + ` Show terminal
Ctrl + Shift + ` New terminal
Ctrl + Page 🠝🠟 Navigate terminal group
Alt + 🠝🠟🠜🠞 Navigate terminal in group
Ctrl + Shift + \ Focus terminal tab view
Ctrl + G Goto recent directory
Ctrl + Shift 🠝🠟 Select to command
Scroll
Ctrl + 🠝🠟 to command
Ctrl + Alt + Page 🠝🠟 line
Shift + Page 🠝🠟 page
Ctrl + HomeEnd to top/bottom

[!kbd|vscode chroma] Navigate File/Code

Alt + 🠜🠞 Navigate history
Ctrl + P Open file
Ctrl + 🠝🠟 Scroll file
Find in file
Shift + F7 next/prev symbol
Shift + F3 next/prev search result
Ctrl + Shift + F3 next/prev selection
Breadcrumbs
Ctrl + Shift + . focus
Ctrl + 🠜🠞 navigate
Fold / Unfold
Alt + HomeEnd block🔹CS+[]
Alt + Page 🠝🠟 all🔹C+K>J
Ctrl + K > nr to level
Ctrl + K > - except selection
Go to
Ctrl + T Symbol in workspace
Ctrl + + U > 1 definition🔹
Ctrl + + U > 2 type definition🔹
Ctrl + + U > 3 references🔹
Ctrl + + U > 4 implementations🔹
└───>ShiftAlt peek/find all🔹
Shift + F4 next/prev reference/implementation

[!kbd|vscode chroma] Selection

Shift + Alt + 🠜🠞 Expand/Shrink selection
Ctrl + Alt + D Add next/all🔹 occ. to selection
Ctrl + Shift + 🠝🠟 Add cursor🔹🔻 CA+🠝🠟
Ctrl + Shift + Delete Undo cursor🔹 C+U

[!kbd|vscode chroma] View

Ctrl + Page 🠝🠟 Navigate tabs
Ctrl + K > Z Zen mode🔹(C+K)>Z
Shift + Alt + 0 Toggle horizontal/vertical
Side Areas
Shift + F1 Focus left sidebar🔹C+B
Ctrl + F1 Toggle left sidebar🔹CA+B
Shift + F2 Focus right sidebar🔹
Ctrl + F2 Toggle right sidebar🔹
Ctrl + J Focus panel🔹C+J
Ctrl + Shift + J Toggle panel🔹CS+J
Ctrl + W Edit Groups
Ctrl + nr focus🔹
Ctrl + Alt + 🠝🠟🠜🠞 navigate🔹
Ctrl + Alt + Enter open in new Edit Group🔹C+Enter
Ctrl + K > M maximize
Ctrl + W Close Editor
Shift others in group🔹🔻
Shift + Alt in other groups🔹
Ctrl + Shift + T Reopen closed editor
Ctrl + W Open
Ctrl + Shift + E Explorer
Ctrl + Shift + X Extensions
Ctrl + Shift + F Search
Ctrl + Shift + G Git
Ctrl + , Settings
Ctrl + K > S Keyboard shortcuts

[!kbd|vscode chroma] Manipulate code

Ctrl + / Toggle comment
Shift + Alt + F Format doc
Ctrl + Alt + L TCL🔸
Shift + Alt + O Organize imports
Lines
Alt + 🠝🠟 move
Shift + Alt + 🠝🠟 duplicate
Ctrl + Shift + K delete
Ctrl + U > J join🔹
Ctrl + L select
Ctrl + G goto
Alt + ,. indent / outdent🔹C+[]
Ctrl + Enter insert up
Ctrl + Shift + Enter insert down
Enclosing brackets
Alt + 🠝🠟 jump between🔹CS+\
Ctrl + U > S select content🔹
Ctrl + Alt + Backspace remove🔹
Transform Case
Ctrl + U > 6 to CamelCase🔹
Ctrl + U > 7 to lowercase🔹
Ctrl + U > 8 to UPPERCASE🔹
Ctrl + U > 9 to kebab-case🔹
Ctrl + U > 0 to snake_case🔹
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment