Skip to content

Instantly share code, notes, and snippets.

function! PythonGetLabel()
if foldlevel('.') != 0
norm! zo
endif
let originalline = getpos('.')
let lnlist = []
let lastlineindent = indent(line('.'))
let objregexp = "^\\s*\\(class\\|def\\)\\s\\+[^:]\\+\\s*:"
if match(getline('.'),objregexp) != -1
let lastlineindent = indent(line('.'))