0

I am currently using a vertical monitor for my vim setup. I absolutely love being able to view 100+ lines of code at once. My eyes can scan longer and more complicated blocks of code.

However, I have noticed that there are times when being able to see 100+ lines of code is actually quite distracting. There are cases when i'm really only concerned with 5-10 lines. This is especially problematic if I look away to my second monitor to read something in my browser; when my eyes go back to vim, I have to rescan the whole monitor to remember where I was.

The ideal situation, personal preference-wise, would be to dynamically fade all rows a certain number of lines away from the center row with a convenient key binding. This would give me the flexibility to zone into narrower blocks of code and be able to quickly get back to looking at the bigger picture if I want to.

Does anyone know a solution like this? If not, I would also appreciate alternative solutions to the same problem or similar problem, which I would generally describe as "the frequent changing of the scope of focus in my editor throughout the day".

1

limelight.vim works great for fading paragraphs of text. I don't know if it works for code blocks also. It can still be a good starting point to look up the fading functionality, since getting current cursor line in vimscript is trivial, with functions line() / winline().

1

Another plugin option is NrrwRgn, which has editing benefits as well.

I’ve seen people use a trick to flash cursorline and cursor column as well, as a sort of "where am I." This is not hard to do, but I’ll see if I can find the exact code later.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.