Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- " If the cursor is currently within a function body, show
- " the function name in the statusline.
- function! VimCurrentFunction()
- let fpos = search('^\s*fu', 'bnW')
- if fpos != 0
- let epos = search( '^\s*endf', 'bnW')
- if (epos == 0) || (epos < fpos) || (epos == line('.'))
- return ', ' . matchlist(getline(fpos), 'function!\?\s*\(\w\+\)')[1]
- else
- return ''
- endif
- else
- return ''
- endif
- endfunction
- set statusline=%f%m%r%h%w\ [%n:%{&ff}/%Y]%=[0x\%04.4B][%03v][%p%%\ line\ %l\ of\ %L\%{VimCurrentFunction()}]
Advertisement
Add Comment
Please, Sign In to add comment