Tom Xue
Tom Xue

Reputation: 3355

How to show the function scope in Vim?

Is there any way to show the function's scope, I mean {...}, in Vim? I use Eclipse ADT, and found that it can do it and it is a very good feature.

screenshot showing eclipse functionality

Upvotes: 1

Views: 988

Answers (1)

Karl Bielefeldt
Karl Bielefeldt

Reputation: 49108

One way to see function scope is to use folding (:help fold) and the foldcolumn option will provide a representation of where the folds are.

Another useful scope feature is [{ and ]}, which jump backward and forward to the next level of braces.

The other useful method if you're having trouble seeing the limits of a function's scope is to make your functions smaller :-)

Upvotes: 1

Related Questions