Created
January 6, 2015 21:56
-
-
Save Su-Shee/6e3c485e915f50e072f2 to your computer and use it in GitHub Desktop.
statusline
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " 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