Skip to content

Instantly share code, notes, and snippets.

@Altreus
Created October 16, 2012 09:02
Show Gist options
  • Save Altreus/3898177 to your computer and use it in GitHub Desktop.
Save Altreus/3898177 to your computer and use it in GitHub Desktop.
set statusline=all\ the\ stuff\ %{FindSub()}\ and\ more\ stuff
function! FindSub()
let subpattern = '\(sub\|function\) \w\+'
let subline = search(subpattern, 'bnW')
if !subline
return 'not in sub'
else
return matchstr(getline(subline), subpattern)
endif
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment