Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select/move/delete by sentence #3

Closed
seatrout opened this issue Oct 1, 2021 · 5 comments
Closed

Select/move/delete by sentence #3

seatrout opened this issue Oct 1, 2021 · 5 comments

Comments

@seatrout
Copy link

seatrout commented Oct 1, 2021

Something missing from Obsidian at present is the ability to perform operations on sentences, rather than lines.

You can do this in Vim mode, but that has other drawbacks. I can see, sort of, how sentences might be defined in pseudocode

  • (search backwards for "[\?\!\.] " ;
  • search forwards for the same pattern or the end of the text;
  • select everything in between)

but I don't know how to put that into typescript or indeed any language other than Python.

Once a sentence is defined as a unit of movement, you can put in the commands that prose writers need:

  • move to next/previous sentence
  • delete from cursor to end/beginning of sentence (I use this all the time, when I get half way through a sentence and realis it has gone wrong)
  • cut and even sometimes copy sentence.

All of these operations are really useful if you're writing continuous prose. I can have a try myself, but I can't guarantee success.

@timhor
Copy link
Owner

timhor commented Oct 1, 2021

That's an interesting idea! I can experiment with this over the weekend.

@seatrout
Copy link
Author

seatrout commented Oct 1, 2021

Thank you!

@timhor
Copy link
Owner

timhor commented Oct 4, 2021

Verdict: I can certainly implement sentence selection using the strategy you've laid out in pseudocode. However, considering the various commands being proposed as well (move, delete, cut, copy), it starts to get out of scope for this plugin.

I'm happy to create a separate plugin though and work on this functionality there instead (unless you'd like to give it a shot yourself). What do you think?

@seatrout
Copy link
Author

seatrout commented Oct 4, 2021

I think that this should maybe be a separate plugin. It would be great if you could make it. I suspect I lack the skill though I guess could try with the help of Marcus Olsson's breakdown and your code. I confess it's a rabbit hole I am trying to stay out of.

@timhor
Copy link
Owner

timhor commented Oct 4, 2021

Sure, I've scaffolded a new plugin at https://github.com/timhor/obsidian-sentence-navigator. You can follow along there 🙂

@timhor timhor closed this as completed Oct 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants