An Obsidian plugin to paste and manage text, including block quotes, that are indented. This plugin helps especially with embedding code, quotes, and other content within lists.
_(This plugin was formerly titled "Paste to Current Indentation".)
Paste Mode takes over the paste functionality within Obsidian. It has eight "paste modes," which determine what happens when one pastes text within a file in Obsidian. All of the below will honor the cursor's current indentation when pasting, except for "Passthrough" mode, which uses Obsidian's default paste functionality.
>
").>
").The current paste mode is displayed in Obsidian's Status Bar:
There are multiple ways to switch paste modes:
Paste Mode: Cycle Paste Mode
. This command is equivalent to clicking the satus bar.Paste Mode: Set Paste Mode
. One command per paste mode is provided.
Paste Mode: Cycle Paste Mode
. This command will cycle through the different paste modes (i.e., from Text mode to Text Blockquote mode, to Markdown mode, to Markdown Blockquote mode, to Passthrough mode, back to Text mode, etc.)Paste Mode: Toggle blockquote at current indentation
command will toggle blockquote markers at the highlighted text's current level of indentation. Block quote markers are customizable via the plugin's Settings page (e.g., if you prefer to use spaces instead of >
).
http://example.com/path/to/file.png
, file://path/to/file.png
, etc.) can be automatically downloaded locally, based on their source location.Characters that might cause display issues in Markdown (such as ==
, <
, etc.) can be automatically escaped when pasting.
I consider this plugin feature-complete for now.
Todo:
The documentation below is retained from the Obsidian Sample Plugin.
.obsidian/plugins/your-plugin-name
folder.yarn
in the command line under your repo folder.yarn dev
to compile your plugin from main.ts
to main.js
.main.ts
(or create new .ts
files). Those changes should be automatically compiled into main.js
.yarn
in the command line under this repo's folder.Mobile development can be facilitated using the following workflow:
yarn dev
with files set to sync to mobile via, e.g., Syncthing or Dropbox.How to test plugins on Android I think you need to have ADB on your computer installed (I always had that installed; if the following directions don’t work without it, install it); on your android phone you have to enable ADB (it’s under developer settings [tap the build number three times to get these settings]); then connect the phone to your computer over USB; open chrome (or chromium based browser should also work) and type chrome://inspect in the browser. Open obsidian on your phone, then it should appear in the browser. You will have the console and the inspector like you have for desktop Obsidian
manifest.json
with the new version number, such as 1.0.1
, and the minimum Obsidian version required for the latest release.versions.json
file with "new-plugin-version": "minimum-obsidian-version"
so older versions of Obsidian can download an older version of the plugin that's compatible.v
). See here for an example: https://github.com/obsidianmd/obsidian-sample-plugin/releasesmanifest.json
, main.js
, and styles.css
as binary attachments.main.js
, styles.css
, manifest.json
to your vault VaultFolder/.obsidian/plugins/obsidian-paste-to-current-indentation/
.