-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Highlight sentence rather than paragraph? #44
Comments
#40 should offer a temporary workaround. Don't know why it was closed without any real solution. |
Oh, I hadn't actually seen the limelight_bop and limelight_eop options. I imagine that I can do something with those! |
I gave a try at the workaround but this cannot work in case of a very long sentence using soft wrapping (a situation often met when writing prose e.g using vim-pencil in SoftPencil mode). |
@josswright @jfmoulin I really wanted this, so I spent the last few days getting it to work. I've got the changes up on my fork of the project, but sometime I'll polish it up enough to submit a pull request here. The way I built it, I didn't leave any of the paragraph stuff in because I don't personally want that, but I'm sure the maintainer here doesn't want only sentences. Here is a view of mine: |
Hi! @josswright, did you have a chance to proceed with this? |
joining back late... |
Ooops. sorry I just gave my own old comment a smile.... anyway to un-smile? |
Just following up here. As far as I can tell from looking at the code, limelight is currently built entirely around highlighting lines. I don't know much vimscript at all, but it looks like it would take a bit of work to make it highlight sentences correctly. I'm interested to start looking at it, but it will involve learning vimscript from scratch, so if anyone more familiar with this code can give more of an idea then I'd be interested! |
@josswright Not sure if you forgot about my fork that gets 95% of the way there...I still use this on a regular basis for myself and just don't think the remaining 5% is worth the hassle for me any longer: https://github.com/ekaj2/limelight.vim |
Oh, sorry @ekaj2. I think I got this confused with the fork that lets you define a region via movement commands, but that can't do per-sentence highlighting due to the need to highlight the entire line. Assuming your version does that, I'll happily skip over to your fork and give it a try! Is there anything special to do to get per-sentence highlighting working? |
@ekaj2: I've just had a quick look. It's definitely highlighting partial lines, and seems never to highlight beyond the end of a sentence, but in almost all cases it's not correctly highlighting sentences when I move the cursor over them. (The actual highlighting behaviour I'm seeing is hard to describe, so I haven't gone into it here. Happy to write up a fuller report if needed, though.) It looks so close to being there, though! |
@josswright For most cases, proper punctuation will do, but I've not implemented everything for sure. I think it works in most cases though, as long as it is normalish prose I guess: |
@ekaj2 I think I've realised the problem. The file(s) that I've tried have hard linebreaks. It works pretty much perfectly on files without linebreaks. Here's a demonstration of a file with hard linebreaks. Assuming this isn't an easy fix, it's already a fairly great improvement over my previous setup. If there is a way to handle hard linebreaks, though, that would be amazing. (I may have a poke at it myself, so a pointer to the best place to look would be really helpful, assuming this isn't something you plan on doing.) |
@josswright I don't think that is possible IIRC, but you should look at my changes here to get the main idea: ekaj2@80b028b. Essentially you use This line will then convert to allow for word wrapping or whatever IIRC:
This will be something else that would probably need to be changed:
You will also need to have a new way of handling paragraphs (double newline) which I don't know is possible... I don't know that the That said, you could also just write with everything on the same line per paragraph and type |
I love using Limelight and Goyo for writing text, after initially discovering it through seeing iA Writer. In a recent look, though, I noticed that iA Writer seems to highlight each sentence rather than each paragraph. I haven't used it, but it seems intuitively more appealing to me.
Would it be possible for Limelight to highlight just the current sentence rather than the current paragraph?
The text was updated successfully, but these errors were encountered: