bairui

HTML Current DIV ID

Dec 5th, 2011
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 0.25 KB | None | 0 0
  1. function! HTMLCurrentDivId()
  2.   let m = searchpos('<\s*div.\{-}id\s*=\s*"\([^"]*\)"', 'bnWp')
  3.   if m[2] == 2
  4.     return matchlist(getline(m[0]), 'id\s*=\s*"\([^"]*\)"')[1]
  5.   else
  6.     return ''
  7.   endif
  8. endfunction
  9.  
  10. set statusline=\%{HTMLCurrentDivId()}
  11.  
  12.  
Advertisement
Add Comment
Please, Sign In to add comment