Is there any way to select a sentence in Obsidian?

Things I have tried

I have searched the help docs, and this doesn’t seem to be possible, yet it is important for prose writers [I know that you can select sentences with the mouse. I need a keyboard shortcut or a potential keyboard shortcut]

What I’m trying to do

I am a prose writer, not a coder, which means that my unit of meaning is the sentence, not the line. Almost every editor I know of recognises the line as a semantic unit, and so has commands to select a line, move to each end, delete it, copy it, and so on. Very few indeed have the corresponding commands for sentences.

Vim does, I think; and of course full-blown word processors like Word and LibreOffice do. The concept certainly exists in Java, because I once had to hack together a couple of macros to do this in a mind mapper written in Java. Scrivener can be taught to do this with Keyboard Maestro or AutoHotKey. Is there a chance that Obsidian could be taught to do this, too?

The lack is one thing holding me back from a full scale commitment to the program. The other is the lack of a proper web clipper, but I’m sure that will be remedied in time.

3 Likes

Agreed that this would be useful.

You mention vim – as a workaround you might see if vim mode has shortcuts for what you want. Of course that means writing in vim mode so maybe that’s not what you want to do.

Hey good question,

If you are willing to learn vim, this is the absolute best way to do it. I’m a writer as well and vim makes my writing experience so much better.

Obsidian has vim keybindings built in, so if you are willing to learn you can just use vim for this kind of stuff.

However I recommend learning how vim works before you activate it, since otherwise you’ll just get frustrated.

I have a quick overview video about vim in Obsidian and I plan to make learning resources soon

Highlighting a sentence in Vim is as easy as shift + v but again in order to use this you need to first learn the basis of vim.


Solution without Vim

This wont work as well as vim, but it’s a lot easier.

You can use the arrow keys plus a combination of shift, control or alt if you are in windows or command , option if you are in mac.

It’s gonna depend on your computer, but as an example if you are at the start of a sentence, you can do ctr+shift + and that selects the whole link

Again this will change if you use mac, so experiment a bit with the combination of arrow keys (plus a combination of shift, control or alt if you are in windows or command , option if you are in mac) for different results.

1 Like

Thank you both. A little poking around on discord, and looking at the Codemirror source, revealed the answer – at least in vim mode. <esc>) and ( will jump around by sentence; <esc>da ) or ( will delete to the end or beginning of the sentence from the cursor.

All I need now do is map those commands onto the chords that my fingers are used to, and there is autohotkey/keyboard maestro for that.

I respect the power of vim, and I use it when I am fooling with raspberry pis, but I don’t think in modes and doing so slows me down when I don’t want my fingers to get in the way of my brain.

1 Like

I honestly think Vim helps you speed up the process of using the mouse to a keyboard centered system. After learning it, it makes the process of writing and editing text effortless and helps reduce interruptions to think clearly. At least that’s my experience.

Best of luck, I’ll mark this as resolved

You can check MarkDowload. It really works well though not an obsidian plugin.

YEs, thanks. I have discovered this, and use it. But it doesn’t clip straight to Obsidian, as I’d wish; and I would also like to implement automatic tagging for the system that I use. That last bit would be perfectly doable with a python script that went through the download files automatically. And I suppose I could set up an obsidian vault for the clips to be dropped into … hmmm.

For what it’s worth, here are the AHK snippets to do what I want:

 
#IfWinActive,Obsidian
^+Backspace::
; Delete sentence backwards
; MsgBox, "You pressed ctrl-shift-Backspace in Obsidian"
; MsgBox, "To delete a sentence backards"
Send, {Esc}d(i
return

^+Delete::
; delete to end of sentence
Send, {Esc}d)i
return

#!Left::
; Move to beginning of sentence
Send, {esc}(i
return

#!Right::
; Move to next sentence
Send, {esc})i
return

– these will also return you to normal editing mode afterwards. I’ll translate them to KM when I start using Obsidian on the laptop.