Skip to content

Commit

Permalink
vimwiki: pandoc command
Browse files Browse the repository at this point in the history
  • Loading branch information
teranex committed Jul 19, 2014
1 parent a3b0172 commit 4a67bce
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions after/ftplugin/vimwiki.vim
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,14 @@ iabbrev <buffer> <expr> sunday_ InsertDateForWeekday(6)
iabbrev <buffer> <expr> today_ strftime("%Y-%m-%d")
iabbrev <buffer> <expr> tomorrow_ strftime("%Y-%m-%d", localtime()+86400)
iabbrev <buffer> <expr> n_ "### ".strftime("%Y-%m-%d %H:%M")."\<CR>\<CR>--------------------------------------------------<Up>\<Up>"

function! PandocConvert(firstLine, lastLine)
let infile = tempname().'.md'
exec ':'.a:firstLine.','.a:lastLine.'w '.infile
let outfile = tempname().'.html'
exec '!pandoc -o '.outfile.' '.infile
exec '!firefox '.outfile
redraw
endfunction

command! -range=% Pandoc call PandocConvert(<line1>, <line2>)

0 comments on commit 4a67bce

Please sign in to comment.