menu.vim 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. " vim: set fdm=marker et ts=4 sw=4 sts=4:
  2. function! pandoc#menu#Init() abort
  3. call pandoc#menu#CreateMenu()
  4. au! VimPandoc BufEnter <buffer> call pandoc#menu#CreateMenu()
  5. au! VimPandoc BufLeave <buffer> silent! aunmenu Pandoc
  6. endfunction
  7. function! pandoc#menu#CreateMenu() abort
  8. if index(g:pandoc#modules#enabled, 'command') >= 0
  9. amenu Pandoc.Compile.&Pdf :Pandoc pdf<CR>
  10. amenu Pandoc.Compile.&Beamer :Pandoc beamer<CR>
  11. amenu Pandoc.Compile.&ODT :Pandoc odt<CR>
  12. amenu Pandoc.Compile.&HTML :Pandoc html -s<CR>
  13. amenu Pandoc.Compile.-Sep1- :
  14. if exists('g:pandoc#command#templates_file')
  15. for temp in pandoc#command#GetTemplateNames()
  16. exe 'amenu Pandoc.Compile.'.temp.' :Pandoc #'.temp.'<CR>'
  17. endfor
  18. endif
  19. amenu Pandoc.Compile\ and\ View.Pdf :Pandoc! pdf<CR>
  20. amenu Pandoc.Compile\ and\ View.Beamer :Pandoc! beamer<CR>
  21. amenu Pandoc.Compile\ and\ View.ODT :Pandoc! odt<CR>
  22. amenu Pandoc.Compile\ and\ View.HTML :Pandoc! html -s<CR>
  23. amenu Pandoc.Compile\ and\ View.-Sep1- :
  24. for temp in pandoc#command#GetTemplateNames()
  25. exe 'amenu Pandoc.Compile\ and\ View.'.temp.' :Pandoc! #'.temp.'<CR>'
  26. endfor
  27. amenu .699 Pandoc.-Sep1- :
  28. endif
  29. amenu .900 Pandoc.Help :help pandoc<CR>
  30. endfunction