Skip to content

Instantly share code, notes, and snippets.

@gaving
Created December 4, 2009 09:30
Show Gist options
  • Save gaving/248930 to your computer and use it in GitHub Desktop.
Save gaving/248930 to your computer and use it in GitHub Desktop.
function! ToggleXHTML()
if &ft != 'xhtml'
let s:oldFileType = &ft
set ft=xhtml
else
if exists('s:oldFileType')
let &ft=s:oldFileType
else
echo "No previous filetype"
endif
endif
endfunction
command! ToggleXHTML call ToggleXHTML()
map <silent><Leader>h :call ToggleXHTML()<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment