Skip to content

Instantly share code, notes, and snippets.

@schoettl
Last active October 11, 2016 19:19
Show Gist options
  • Save schoettl/43fe190327df0bf31829df5549590782 to your computer and use it in GitHub Desktop.
Save schoettl/43fe190327df0bf31829df5549590782 to your computer and use it in GitHub Desktop.
Vim mapping with range
function! ExportAndOpenHtml() range
execute a:firstline . ',' . a:lastline . 'TOhtml'
execute 'silent !xdg-open %'
quit
redraw!
endfunction
nnoremap <Leader>h :0,$call ExportAndOpenHtml()<CR>
vnoremap <Leader>h :call ExportAndOpenHtml()<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment