Skip to content

Instantly share code, notes, and snippets.

@Su-Shee
Created January 6, 2015 21:56
Show Gist options
  • Select an option

  • Save Su-Shee/6e3c485e915f50e072f2 to your computer and use it in GitHub Desktop.

Select an option

Save Su-Shee/6e3c485e915f50e072f2 to your computer and use it in GitHub Desktop.
statusline
" statusline:
set statusline=%-10.(%l\ of\ %L%)\ \ %<%r%{FindSub()}\ \ \ %=%{GitBranchInfoTokens()[0]}\ \
" find sub:
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