Skip to content

stdword/logseq13-missing-commands

Repository files navigation

                   Missing Commands, Views & Features

Version Downloads

A part of the Logseq13 family of plugins

Summary

Missing, but helpful commands, views & features for Logseq

Designed to be very productive with keyboard ❤️

 

ℹ️ Some commands has default shortcut and some not.

To find out the shortcut for the particular command (or bind your own) use this instruction.

Any command could be called from Commands Palette

 

❗️ Some parts of this plugin heavily rely on Logseq's Document Object Model (DOM) structure. This means that every Logseq update could potentially break specific plugin functions. If you notice anything unusual, please create an issue with details.

 

⚠️ GitHub may need some time to load all demo animations (GIF) in collapsed blocks on this page.

 

1) ⛓️ Features

TAB-trigger on Search

To fill the input with selected search item. Just press the tab key to speed up the input values.

Fast access to current page name on Search

Helpfull, when you need to access subpages of the current page. Just press the arrow key on empty search input.

Go to the block start (end) with double-pressing the «Home» («End») key

Just like in Sublime Text editor. MacOS's ⌘ ← / ⌘ → and Windows's fn ← / fn → are also supported.

Restriction: This feature only works for natural lines of block, which have a «new line» character or «\n». It does not work with lines created due to the size of the layout. In such cases, the only way to proceed is to press Esc to exit edit mode and then use the or arrow key to re-enter it.

Spare space between 1-level blocks

Increase the space between 1-level blocks in order to clearly separate them from each other.

Motivation: blocks on the first level represent the most general parts of the information, which usually stand separately: headings, categories, clients, code snippets, links, etc.

Edit block on mouse click on page reference or tag with (or Alt for Windows) key

Restriction: this feature only works for the first page reference or tag. There is no way to recognize the others if they are the same.

2) 🔧 Blocks reordering

Toggle auto heading

Without accessing block context menu.

Sort / reverse / shuffle blocks

Note: To sort in descending order use sort and then reverse commands.

Note: Sort and reverse commands available via block context menu. Shuffle command only via Command Palette

3) 🔧 Fast navigation

Go to (↑) previous / (↓) next block

Instantly goes to next / prev block. Even with multiline blocks.

Note: cursor position saves from block to block.

before     &     after

Go to (↖︎) parent / (↘︎) last child block

Navigating whole block tree throught diagonal — jumping between the parent and the last child block.

Go to |↑| previous / |↓| next sibling block

Jumping between sibling blocks only.

Note: cursor position saves from block to block.

Note: we cannot leave current parent.

Note: the difference from prevous command is skipping all child blocks.

4) 🔧 Blocks movements

Outdent (⇤) children of the block

Perform outdent (indent to the left) for every child of the particular block.

Note: standard Logseq commands ⇧⇥ can acheive this, but it required to select all child blocks manually one by one before using it.

Move block (⤒) on top / (⤓) on bottom of siblings

Instantly makes block the first (or the last) child of the parent.

Note: standard Logseq commands ⌘⇧↑ or ⌘⇧↓ can acheive this, but via one step at a time.

5) 🔧 Splitting & Joining blocks

Magic Split & Magic Join

Search block content for ordered / unordered lists and split it to corresponding blocks structure.

Note: supported numeration style: 1. 1) (1) 1.2) for arabic & roman numbers and letters from alphabet.

Note: supported bullets style: - + *.

Split     &     Join

Split by lines / Join via new lines

Simple command to pick out each line of block to separate block (and vica-versa).

Note: There are two types of join command: with respect to block structure and without it.

Split     &                     Join

Split by words / Join via spaces

Get all words from the text and place it at the separate blocks (and vice-versa).

Note: Words could contain letters, ', _ & - characters.

Split     &                     Join

Split by commas or semicolons / Join via commas

Split the text by commas (or semicolons with the separate command).

Join separate blocks via commas.

Note: Joining can respect the root node with colon «:».

Split / Join sentences

Split paragraph of text by sentences (one block = one sentence). And join the blocks to single paragraph.

Note: Split removes the dots at the end. Join returns the dots back.

Split     &     Join

6) 🔧 Updating blocks

Magic Bold / Italics / Underlne / Hightlight / Strikethrough / Code / Reference / Tag / Quotes

Apply various formatting in a smart way: auto-select whole words, recognize Logseq special syntax, smart undo formatting, and work out of editing mode.

To use it in edit mode:

  1. Go to the Keymap (g s) → Formatting section and replace standard Logseq commands (Bold, Highlight, Italics, Strikethrough) with magic ones.
  2. Bind Magic underline, Magic `code`, Magic [[reference]], Magic #tag and Magic "quotes" commands to shortcuts of your choice (e.g. ⌘U, ⌥~, etc.).

Note: command uses «_» for italics to prevent this cases.

Remove new lines

Remove all «new line» characters from text. Helpful for work with OCR texts.

Note: command adds spaces when it's necessary.

Trim lines punctuation ". , ;"

Remove any of «. , ;» characters from the end of every line of text.

Note: command removes only one punctuation character.

Lower / upper / title letters case

Note: title case command has two variations — title words and title sentences.

Remove HTML tags

Remove all HTML tags from the block, leaving only the text content.

Note: there is no exceptions — everything between «<» and «>» will be removed.

Parse YouTube timestamps

Transform copied from YouTube timestamps to Logseq format.

7) 🔭 Views

Hide references started with «.»

Hide any page and tag references that start with the dot: «.», assuming that these are special reserved references that do not need to be shown.

Note: there are two ways of hiding:

Hide by wrapping to «…» only                     &   Hide completely and show on block hover

Tabular view

Use the #.tabular reference in a block to apply a Tana-like tabular view for all its children.

Note: it could be nested — #.tabular inside another #.tabular. However, only two-level depth is supported.

Use the #.tabular0 reference in another tabular row to skip the immediate children.

Use the #.tabular0 reference to hide heading block.

FAQ: How to return back double square brackets for page references in the left column?

Add following code to custom.css:

    .ls-block[data-refs-self*='".tabular'] > .block-children-container > .block-children > .ls-block > .block-main-container > .block-content-wrapper .page-reference .bracket {
      display: inline-flex;
    }
  
Columns view

Use the #.columns reference to organize child blocks to columns of the same width.
Note: 1 column = 1 block.

Use the #.columns-N reference to organize child blocks to N columns of the same width, where N = 2…6.
Note: 1 column = 1 or more blocks.

Use the #.columns-fit reference to organize child blocks to columns with different width (based on content).
Note: 1 column = 1 block.

Gallery view

Use the #.gallery reference to organize child blocks containing images to gallery.
Note: image sizes automatically fills whole space for width. There is only one row of images.

Use the #.gallery-wN reference to organize child blocks containing images as fixed-width (based on N) images.
Note: there can be multiple rows of images.

Use the #.gallery-hN reference to organize child blocks containing images as fixed-height (based on N) images.
Note: there can be multiple rows of images.

Border view

Use the #.border & #.border-child references to organize borders around the blocks.
Note: these references can be combined.

If you ❤️ what I'm doing — consider to support my work

Buy Me A Coffee

Installation

From Logseq Marketplace (recommended way):

    

  • Click «...» and open the «Plugins» section (or press t p)
  • Click on the «Marketplace»
  • On the «Plugins» tab search for «Missing Commands & Views» plugin and click install
  • If you want to change default shortcuts commands — go to «Keymap» (g s)

Manual way (in case of any troubles with recommended way)

  1. In Logseq: Enable «Developer mode» in «...» → «Settings» → «Advanced»
  2. Download the latest plugin release in a raw .zip archive from here
  3. Unzip it
  4. In Logseq: Go to the «...» → «Plugins», click «Load unpacked plugin» and point to the unzipped plugin folder
  5. ⚠️ The important point here is: every new plugin release should be updated manually

FAQ

How to change default shortcut for the particular command?

  1. Open «Settings» → «Keymap» (or press g s).
  2. Copy this emoji «🪚» (for Windows use «🔪») and insert it to search input.
  3. Change any shortcut you want

Why I cannot revert the result of particular command with one Undo action?

This is a restriction of the Logseq API: there is no way to execute complex commands in a single Undo. Therefore, the plugin attempts (when it makes sense) to minimize the count of Undo actions by removing the entire block tree instead of removing each block independently.

Why there is strange «ø» charactear appears sometimes during Undo command?

The reason is this bug in Logseq plugin API. The plugin uses «ø» character intentionally as a workaround for this issue. When the bug is resolved, this workaround will no longer be necessary.

Additional helpful plugins with the same vibe

Credits

Some parts of this plugin based on reviewed and refined works of another authors:

License

MIT License