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

allow to use movements to define paragraphs #57

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

xi
Copy link

@xi xi commented Feb 22, 2019

I really like this plugin, but it feels a bit awkward that it comes with its own definition of what a paragraph should be, considering that vim already has a definition for that.

I propose to allow to use movement commands such as {, (, [[, and [z to define paragraphs. While this might not be perfect, it could make requests like #38, #44, or #52 more feasible.

Note that this pull request includes the changes from #56 because I didn't want to separate them only to deal with merge conflicts afterwards.

@josswright
Copy link

I've just tried this (in NeoVim 0.4.3, in case it's relevant). I have the following in my init.vim:

let g:limelight_mode = 'movement'
let g:limelight_bop = '('
let g:limelight_eop = ')'

As far as I can tell, this seems to be highlighting most of the document, although it seems to break somewhere around actual parenthesis characters. I'm certainly not getting the expected sentence highlighting, though!

Am I doing something wrong? Is this not working as expected? Is there any way I could get this behaviour?

@xi
Copy link
Author

xi commented Mar 9, 2020

Hi @josswright. It's hard to know exactly what went wrong. I just tested this code with neovim 0.3.4 and it worked fine. Can you provide more information on what you expected and what you got instead?

Note that this plugin can only highlight lines. So if a sentence starts in the middle of a line, that whole line will be highlighted.

Can you maybe try highlighting a paragraph with { and }? That should create more predictable results.

@josswright
Copy link

Hi @josswright. It's hard to know exactly what went wrong. I just tested this code with neovim 0.3.4 and it worked fine. Can you provide more information on what you expected and what you got instead?

Note that this plugin can only highlight lines. So if a sentence starts in the middle of a line, that whole line will be highlighted.

Can you maybe try highlighting a paragraph with { and }? That should create more predictable results.

I tried this with '{' and '}' as well. I'm editing LaTeX, so curly braces turn up fairly often. What I seem to be seeing right now is that this is highlighting all lines between any '{' or '}' character and the next instance of either of those characters.

Is the line-level highlighting a feature of Limelight itself? As I never got it working beyond the paragraph level, I never ran into this. Is that a Vim restriction or a Limelight restriction?

@toejough
Copy link

this is working fine for me in neovim right now (v0.4.3). This is exactly the enhancement I was looking for - thanks @xi !

@toejough
Copy link

toejough commented May 8, 2020

something in this PR broke my stack navigation - I can get into a place where I'm jumping between two functions and then that's all I can do. if I type :jumps to see my stack, the pointer is always at the bottom.

disabling this option allows me to use ctrl-o and ctrl-i to navigate my stack like normal.

@mtshrmn
Copy link

mtshrmn commented Nov 15, 2020

Hey this is a perfect solution for the problem, everything seems to work smoothly.
I'd really like to see this in the master branch.

@onliner10
Copy link

Any chance we could merge this?

eldipa added a commit to eldipa/limelight.vim that referenced this pull request Dec 25, 2022
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

Successfully merging this pull request may close these issues.

5 participants