Skip to content

Instantly share code, notes, and snippets.

@dahu
Created August 1, 2012 14:24
Show Gist options
  • Select an option

  • Save dahu/3227307 to your computer and use it in GitHub Desktop.

Select an option

Save dahu/3227307 to your computer and use it in GitHub Desktop.
show HTML Current div in statusbar
function! HTMLCurrentDivId()
let m = searchpos('<\s*div.\{-}id\s*=\s*"\([^"]*\)"', 'bnWp')
if m[2] == 2
return matchlist(getline(m[0]), 'id\s*=\s*"\([^"]*\)"')[1]
else
return ''
endif
endfunction
set statusline=%f%m%r%h%w\ [%n:%{&ff}/%Y]%=[0x\%04.4B][%03v][%p%%\ line\ %l\ of\ %L,\ \%{HTMLCurrentDivId()}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment