Line Cut Guard stops Ctrl+X from cutting a whole line when nothing is selected

Ctrl+X or Cmd+X with only a cursor does nothing, and selected text is cut as usual.

MIT · no telemetry · core features free

Live Preview with the cursor in a paragraph after Ctrl+X, where the paragraph stays and a notice says that nothing is selected.
Open larger
version
1.0.0
released
downloads
3
review
Passed
health
Excellent
license
MIT
listed for
Desktop, Mobile
obsidian
1.13.4 or later

The tests run in the mobile emulation of Obsidian, not on a real phone. The plugin acts on cut and copy events, for example from a keyboard on a tablet.

Directory facts fetched from community.obsidian.md/users/theluckystrike.

About Line Cut Guard

You press Ctrl+X by mistake in Obsidian and do not want it to remove the paragraph under your cursor.

In Obsidian, Ctrl+X with only a cursor cuts the full line or paragraph under the cursor. A key pressed by mistake or held a little too long can remove a paragraph, and you may not see it at once. With Line Cut Guard, Ctrl+X with nothing selected does nothing, and selected text is cut as usual.

Ctrl+C has the same choice. With no text selected, Obsidian copies the whole line, so a Ctrl+C that was meant to be Ctrl+V replaces your clipboard. You can turn that off too.

A meeting note in Live Preview: Ctrl+X with the cursor in a paragraph shows a notice and the paragraph stays, then two selected words are cut as usualPlay demo

Free features

Ctrl+X with only a cursor does nothing

Put the cursor in a paragraph and press Ctrl+X. The note does not change, the clipboard keeps what it had, and a short notice says that nothing is selected. It works in Live Preview and Source mode, in a table cell and with more than one cursor.

Live Preview with the cursor in a paragraph after Ctrl+X, where the paragraph stays and a notice says that nothing is selected.
Open larger

Commands for a line cut on purpose

The command Cut selection or line cuts the selected text, or the line of each cursor when nothing is selected. Copy selection or line does the same for copy. Give them a hotkey, for example Ctrl+Shift+X.

The command palette with the commands Cut selection or line and Copy selection or line.
Open larger

The free version has the Ctrl+X and Ctrl+C settings, the notice and the two commands, and it has no second press mode.

Pro features

Pro costs $5 a month or $15 one time through GitHub Sponsors. One sponsorship turns on Pro in every plugin that has it.

Second press mode Pro

With the Pro option Cuts the line on a second press, the first Ctrl+X with nothing selected only shows a hint. Press Ctrl+X again within 2 seconds without a move of the cursor, and the line is cut. A key that you hold down does not count as a second press.

Live Preview after a first Ctrl+X in the second press mode, with a notice to press Ctrl+X again.
Open larger

Set up Line Cut Guard

needs

  • Obsidian 1.13.4 or later

steps

  1. Turn on Line Cut Guard. There is nothing else to set up.

  2. Press Ctrl+X with only a cursor, and the notice tells you that nothing is selected.

  3. To cut a line on purpose, select it first, or run Cut selection or line.

  4. To stop Ctrl+C as well, set Ctrl+C with nothing selected to Does nothing.

If the app can't find a new plugin yet, try again later. Obsidian says a plugin that passes the review shows in the app within 24 hours.

Why this exists

A forum request to disable the cut of an unselected paragraph has been open since June 2023. The topic has 43 likes and 31 posts.

Need a change for your team? I build custom Obsidian plugins and features.

Questions about Line Cut Guard

Does it change my notes?

No. The plugin only stops a cut or a copy. The two commands change the note in the same way as Ctrl+X in Obsidian, and a command cut writes the clipboard first.

Where does it work?

It works in the text of every Markdown editor: Live Preview, Source mode, a table cell and a Canvas text card in edit mode. Reading view, the search field and the file list keep their usual cut and copy.

How do I get the Obsidian line cut back?

Set Ctrl+X with nothing selected to Cuts the line (Obsidian default), or turn the plugin off. The settings say Cmd instead of Ctrl on macOS.

What does it do when it is not sure?

It lets the cut through. This happens in a read-only editor, when a rendered image or embed has the focus, and in an editor of an unknown kind.

Network use

Until you select Sign in with GitHub, Line Cut Guard makes no network requests. Sign in and the sponsorship check contact github.com and api.github.com with the scope read:user, and a successful check is reused for 7 days. The plugin sends no note content, file names or other vault data.

Read the full network disclosure

Questions or ideas?

Tell me what is broken in Line Cut Guard, or what it should do next.

Send feedback

Line Cut Guard 1.0.0, MIT license

MIT · no telemetry · core features free