Keyboard hotkey to select current sentence (not line)

UPDATE: To be clear, we are talking about a literal sentence, demarcated by end-stopping punctuation. We are not referring to a line or block demarcated only by line breaks.


Use case or problem

When writing prose in Obsidian, I often need to manipulate a sentence.

E.g., deleting a sentence, applying bold or italics to a sentence, or changing the capitalization of a sentence using the text format plug-in.

The ability to quickly select a sentence via keyboard increases the accessibility of the application for users who have limited use of the mouse and keyboard due to disability. With repetitive strain injury, clicking and dragging the mouse or using several chorded keystrokes via the arrow keys to select a sentence can be a physical hardship.

A select current sentence hotkey also makes text selection easier for users who do not have the resources or incentive to invest in learning Vim, which has limited use for those who do not work with code editors.

Proposed solution

Assign a customizable keyboard shortcut to select the current sentence, similar to Microsoft Word, Writemonkey, and other prose-focused editors.

The default hotkey for the mentioned editors is usually a Function hotkey such as F8. When pressed, a sentence is selected, as delimited by the characters new line, ., !, ?, and " depending on the context.

Current workaround (optional)

Currently, the only ways to select a sentence are by:

  • Reaching for the mouse
  • Using vim
  • Using Ctrl/Cmd/shift/arrow keys to select the desired text

Related feature requests (optional)

A discussion of the same need, but not a feature request:

Feature request to select current line. Related but distinct and has many of the same justifications as the select sentence hotkey currently being proposed.

6 Likes

My plugin “Text Transporter” which is in beta can select a line or block. Not a sentence though.

I keep hearing a lot great things about your plug-in. Looking forward to trying it out once it’s in the community plug-in area of the Obsidian app.

If Obsidian “local/in-pane” search-bar supported regular expressions as the “global” search-pane does (/enclosed between slashes/), then it might be easy to create AutoHotkey function that triggers search bar, pastes appropriate regex, selects the sentence and optionally hides search-bar.

Plugins (e.g. the “Text Transporter”) might be able to implement sentence selection via regex alone, without waiting for implementing regex support in search-bar.

current workaround:

  • Open in default app
    • issue: repeated switching between Obsidian and other app that supports the command does not lead to efficient workflow.

Related feature requests:

I have a little plugin working that does exactly this but I have not released it into the wild yet. The “Extract highlights” plugin will highlight a sentence, but that may not be what you want.

Sentence Navigator (the plugin @acbrown was referring to) should suit your use case.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.