2

I am using vimwiki as my local wiki and keep it in git in order to be able to sync it with various pcs. I am trying to automate the process of putting the generated HTML from vimwiki on my server so I can easily look stuff up.

My idea is to checkout the repository on a regular basis on the server and have shell script in place which calls vim and tells him to execute VimwikiAll2HTML, ending afterwards. I can then symlink the html folder somewhere or point nginx there or whatever.

I was able to figure out that I can directly execute a command when calling vim by using the -c parameter:

vim -c "VimwikiAll2HTML" -n index.wiki

This command automatically generates the correct HTML. However, I have to press a key and then quit vim (:q) in order to get back into the shell. It doesn't seem suited to be run inside a bash script run by cron? Can I change the command somehow in order to exit after the html generation finished? Or is there any other way I'm not aware of? I looked into the vimwiki plugin because I thought that it maybe uses an external library for HTML generation which I can call in my script but it seems that the plugin does everything by itself.

2
  • 1
    just a suggestion, what I am doing is, sync the generated HTMLs to github (github-page), since there are some private stuff in my vimwiki, I sync my vimwiki to dropbox. In this way I can access my wiki anywhere in browser, as long as github is up and running. Commented Apr 11, 2014 at 11:04
  • I thought about this. I am editing the wiki on pcs which don't have dropbox access for various reasons and I don't put my private wiki on github ;) But it's possible of course, so thanks for the suggestion! Commented Apr 11, 2014 at 12:03

1 Answer 1

2

This command should work:

$ vim -c VimwikiAll2HTML -c q index.wiki
Sign up to request clarification or add additional context in comments.

1 Comment

Wow, that was easy. Thank you very much. I played around with putting two commands in one -c parameter but didn't thought about using two -c parameters.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.