How can we have a vertical line shown between the braces in vim editor. It is helpful when I am writing C code.
Upto now, while using vim editor, if i want to know the position of the closing brace, i do following:
In normal mode, I take the cursor to opeining brace {
and then press %
which take the cursor to closing }
.
And then (try) to remember the line numbers of opening and closing brace.
But when I do this I often forget the line numbers of opening and closing braces. Plus, many times the brace pairs are nested which makes it more confusing to remember.
So I want to have a vertical line drawn between the braces, so that I can do the following:
{
and press j
or k
(or even %
or any other motion command) to navigate through the file. But with an added line on the left side so that i can know which block I am in.So, if the code is indented properly, then by looking at the line on the left side I will always have a track of which block I am in. And can use j
and k
(or any other motion command) without having to remember the line number of opening and closing brace.
How can we do this in vim ?
Update: Got the answer here Is it possible to display Indentation guides in Vim? .
The indentLine plugin can help you https://github.com/Yggdroot/indentLine (new location)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With