9

I have a source file containing a long list of deeply nested heterogenous structures. Since the structures are long, I would like to:

  1. Use the :split command to split the screen into two.
  2. Scroll down one window and up the other window. When the cursor on window 1 is over a parenthesis, and the other parenthesis is visible in the other window, I want the other parenthesis in the other window to become highlighted (just as it would had it been displaying in the same window).

How can I accomplish the second step?

9

I don't think there's any way to do this, however a better approach in this case would be to leverage vim's folding to fold away part of the code between the structures you're interested in and that can make it a lot more easy for you to visually see the matching brackets.

You can also use % to jump between the start & end parenthesis too to get a fair idea of where's what.

| improve this answer | |
  • Thank you for your reply. I think the % is useful but not ideal in my case since the opening brackets and closing brackets of my structure are not on the same column and jumping around with the cursor causes the whole screen to change. I'm exploring folding at the moment to see if it could be useful, but I will ask about that in a separate post as I have encountered some problems with it (which I think could be solved). – John Sonderson Feb 6 '15 at 16:32
  • As for the feature I requested in my post, perhaps I should submit a feature request. – John Sonderson Feb 6 '15 at 16:33

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.