Compiling markdown Simplenotes with pandoc.vim and simplenote.vim

0

I would like to use pandoc.vim to compile markdown Simplenotes that I edit in Vim using simplenote.vim. To use pandoc.vim I set my Simplenote file type to pandoc with let g:SimplenoteFiletype = "pandoc" in my _vimrc (I'm on Windows most of the time).

I don't understand Vim well enough to know why this doesn't work. If I use the default pandoc.vim executors I get the normal response as though the pandoc command completes successfully, but I can't find the output file. I thought at first that this was because my default directory wasn't writable, but I added cd $HOME to my _vimrc so that :pwd yields C:/Users/richard.

Is there a way to do this, or should I plan on explicitly saving files locally before I run pandoc? Thanks.

Richard Herron

Posted 2013-10-12T21:16:07.183

Reputation: 1 027

Answers

1

Setting g:SimplenoteFiletype to pandoc doesn't do anything, according to the simplenote source code. (Look at autoload/simplenote.vim on project's github) The only filetype that has any effect is markdown.

By default, simplenote uses a scratch buffer, which is not necessarily associated with a file. Pandoc internally uses the name of file in its commands. It probably gets confused when it doesn't find a name.

Saving the notes to a file would probably help.

Roland Smith

Posted 2013-10-12T21:16:07.183

Reputation: 1 712

Thanks! But now that I try this, I can't save with :w or :save because Simplenote.vim uses :w to update Simplenote.com with the current buffer. – Richard Herron – 2013-10-15T08:44:53.967

@RichardHerron: Are you sure it doesn't work if you use the form :w filename.txt? As far as I can tell from the simplenote source code, it simple adds an autocommand to the buffer write hook. AFAIK that doesn't replace the write. – Roland Smith – 2013-10-16T19:27:52.583

I can't generate a file with either :w file.md or :w /path/to/file.md. I'll drop the package writer a line. Thanks for the help! – Richard Herron – 2013-10-17T01:47:26.923