When I look at python code, I find it is hard to find out where is the end of a function if it has too much lines of code.
I first think about just to find next def will be ok. But if the function is a decorator like below, this method doesn’t work.
def require_player(view_func):
@warps(view_func)
def decorate(request, *args, **kwds):
#my code here
return
return decorate
So my want to know is is there any good way to do this in vim?
python-mode has keybindings for this: e.g.
[[and]]will jump back and forth between top-level functions. In your case, it would ignore the innerdef, which I think is what you’re asking.It’s a lot of Kool-Aid to drink, but so far I haven’t seen any serious overhead when not using its features. So I leave it installed and go see what else it can do when I feel like it—kinda like I do with vim.