#If I can do it in Vim, I’ll be happy
##But if I can’t do it in vim, then I won’t
Because there are so many other things I need to do that can be done in vim.
This has been at least part of my inability to keep my past blog attempts up-to-date. I believed that there was some “best practice” structure that I wasn’t using that would make blogging the simple and enjoyable hobby that it seems to be for so many people. I guess this is not the case. However, I am using a great template that I like (HPSTR, by Michael Rose) and I am starting to get the markdown-jekyll-github cycle better (thanks to Andee Kaplan and Alex Shum) so this is getting easier. It also helps that I started this time intentionally using vim and building my workflow around vim. I wrote the following two functions with the goal of making blogging easier.
##The functions
At the moment, I have my blog on github, which is synched with
on my computer.
I use R for most of my coding.
For example, instead of directly using TeX,
I use 1
~/github/imouzon.github.io/
files and compile the code through knitr
even when the amount of R code in the document is negligible.
The main reason I do this is that I wrote a bunch of functions that make
using rnw files so easy that writing even a plain LaTeX document
is much faster if I start with the rnw file.
For the same reason, I am using Rmarkdown files and creating
markdown files from them. This can (I have been told) cause problems
with github and thus I have created an folder Rmarkdown in my page folder that
is include in my .gitignore.1
.rnw
So starting a new post, which will alway be stored initially
in
requires
a few steps which are always basically the same.
The following vim function helps me do this:1
~/github/imouzon.github.io/Rmarkdown/
And I created the quick command:
Additionally, using R and knitr to create the markdown file from the Rmarkdown file requires another set of steps that are basically the same. Thus I wrote the following vim function:
Note: LOL that the jekyll highlight tag for code written to be run by vim is vim and not vimscript.