Skip to content

Paste Rules

Limitations

  • The plugin only works with the standard pasting (cmd/ctrl + v) shortcut, and not with the p operator in vim. (Pasting with cmd/ctrl + v in normal or insert mode does work though.)
  • To avoid conflicts with Plugins like Auto Link Title or Paste URL into Selection, will not be triggered when an URL is detected in the clipboard.
  • On mobile, in order to paste the URL, ensure you perform the Tap and Hold -> Paste action to paste into your document and use the paste rules.
  • When doing a multicursor multiline paste, the cursors will stay where they were after pasting the values instead of moving to the end of the pasted value

Add Blockquote Indentation on Paste

Alias: add-blockquote-indentation-on-paste

Adds blockquotes to all but the first line, when the cursor is in a blockquote/callout line during pasting

Examples

Line being pasted into regular text does not get blockquotified with current line being `Part 1 of the sentence` Before:
was much less likely to succeed, but they tried it anyway.
Part 2 was much more interesting.
After:
was much less likely to succeed, but they tried it anyway.
Part 2 was much more interesting.
Line being pasted into a blockquote gets blockquotified with current line being `> > ` Before:
This content is being added to a blockquote
Note that the second line is indented and the surrounding blank lines were trimmed
After:
This content is being added to a blockquote
> > Note that the second line is indented and the surrounding blank lines were trimmed

Prevent Double Checklist Indicator on Paste

Alias: prevent-double-checklist-indicator-on-paste

Removes starting checklist indicator from the text to paste if the line the cursor is on in the file has a checklist indicator

Examples

Line being pasted is left alone when current line has no checklist indicator in it: `Regular text here` Before:
- [ ] Checklist item being pasted
After:
- [ ] Checklist item being pasted
Line being pasted into a blockquote without a checklist indicator is left alone when it lacks a checklist indicator: `> > ` Before:
- [ ] Checklist item contents here
More content here
After:
- [ ] Checklist item contents here
More content here
Line being pasted into a blockquote with a checklist indicator has its checklist indicator removed when current line is: `> - [x] ` Before:
- [ ] Checklist item contents here
More content here
After:
Checklist item contents here
More content here
Line being pasted with a checklist indicator has its checklist indicator removed when current line is: `- [ ] ` Before:
- [x] Checklist item 1
- [ ] Checklist item 2
After:
Checklist item 1
- [ ] Checklist item 2
Line being pasted as a checklist indicator has its checklist indicator removed when current line is: `- [!] ` Before:
- [x] Checklist item 1
- [ ] Checklist item 2
After:
Checklist item 1
- [ ] Checklist item 2
When pasting a checklist and the selected text starts with a checklist, the text to paste should still start with a checklist Before:
- [x] Checklist item 1
- [ ] Checklist item 2
After:
- [x] Checklist item 1
- [ ] Checklist item 2

Prevent Double List Item Indicator on Paste

Alias: prevent-double-list-item-indicator-on-paste

Removes starting list indicator from the text to paste if the line the cursor is on in the file has a list indicator

Examples

Line being pasted is left alone when current line has no list indicator in it: `Regular text here` Before:
- List item being pasted
After:
- List item being pasted
Line being pasted into a blockquote without a list indicator is left alone when it lacks a list indicator: `> > ` Before:
* List item contents here
More content here
After:
* List item contents here
More content here
Line being pasted into a blockquote with a list indicator is has its list indicator removed when current line is: `> * ` Before:
+ List item contents here
More content here
After:
List item contents here
More content here
Line being pasted with a list indicator is has its list indicator removed when current line is: `+ ` Before:
- List item 1
- List item 2
After:
List item 1
- List item 2
When pasting a list item and the selected text starts with a list item indicator, the text to paste should still start with a list item indicator Before:
- List item 1
- List item 2
After:
- List item 1
- List item 2

Proper Ellipsis on Paste

Alias: proper-ellipsis-on-paste

Replaces three consecutive dots with an ellipsis even if they have a space between them in the text to paste

Examples

Replacing three consecutive dots with an ellipsis even if spaces are present Before:
Lorem (...) Impsum.
Lorem (. ..) Impsum.
Lorem (. . .) Impsum.
After:
Lorem (…) Impsum.
Lorem (…) Impsum.
Lorem (…) Impsum.

Remove Hyphens on Paste

Alias: remove-hyphens-on-paste

Removes hyphens from the text to paste

Examples

Remove hyphen in content to paste Before:
Text that was cool but hyper-
tension made it uncool.
After:
Text that was cool but hypertension made it uncool.

Remove Leading or Trailing Whitespace on Paste

Alias: remove-leading-or-trailing-whitespace-on-paste

Removes any leading non-tab whitespace and all trailing whitespace for the text to paste

Examples

Removes leading spaces and newline characters Before:
         This text was really indented
After:
This text was really indented
Leaves leading tabs alone Before:
        This text is really indented
After:
        This text is really indented

Remove Leftover Footnotes from Quote on Paste

Alias: remove-leftover-footnotes-from-quote-on-paste

Removes any leftover footnote references for the text to paste

Examples

Footnote reference removed Before:
He was sure that he would get off without doing any time, but the cops had other plans.50

_Note that the format for footnote references to remove is a dot or comma followed by any number of digits_
After:
He was sure that he would get off without doing any time, but the cops had other plans

_Note that the format for footnote references to remove is a dot or comma followed by any number of digits_
Footnote reference removal does not affect links Before:
[[Half is .5]]
[Half is .5](HalfIs.5.md)
![](HalfIs.5.jpg)
![[Half is .5.jpg]]
After:
[[Half is .5]]
[Half is .5](HalfIs.5.md)
![](HalfIs.5.jpg)
![[Half is .5.jpg]]

Remove Multiple Blank Lines on Paste

Alias: remove-multiple-blank-lines-on-paste

Condenses multiple blank lines down into one blank line for the text to paste

Examples

Multiple blanks lines condensed down to one Before:
Here is the first line.




Here is some more text.
After:
Here is the first line.

Here is some more text.
Text with only one blank line in a row is left alone Before:
First line.

Last line.
After:
First line.

Last line.