Created
March 15, 2016 21:38
-
-
Save rbnvrw/0dc2fcfe2b43de1d7d7d to your computer and use it in GitHub Desktop.
Pandoc tables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! s:tablePandoc() range | |
exe "'<,'>Tabularize /|" | |
let hsepline= substitute(getline("."),'[^|]','-','g') | |
exe "norm! o" . hsepline | |
exe "'<,'>s/-|/ |/g" | |
exe "'<,'>s/|-/| /g" | |
exe "'<,'>s/^| \\|\\s*|$\\||//g" | |
exe "'<,'>!pandoc -f markdown -t rst" | |
endfunction | |
command! -range=% TablePandoc :call <SID>tablePandoc() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment