1

I'm struggling to explain what I want, and I do not even know if something like this is possible in vim.

I code in PHP / JavaScript.

In a large file, I would like a statusbar to show me:

  • which function the cursor is currently in (this is the main one I want).
  • if possible: what control structures I'm currently in (if/switch/etc).

e.g:

file.php > my_function() > if > if > switch > while

Is this possible, and if so, how?

1 Answer 1

2

I would suggest you to consider installing the context plugin.

It make sure the context lines (function, switch, if) keep visible as long as they are relevant to analyze the code you browse (the current line of the cursor).

2
  • 1
    Wow! From the animated demo, it looks great. Thanks!
    – psx
    Oct 7, 2022 at 13:00
  • 1
    I have a shortcut to toggle it on or off. I find it very useful to analyze long functions or long ifs ;-) Oct 7, 2022 at 13:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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