Pelican.vim is intended to automate the process of creating and editing Pelican blog posts from within Vim_.
This started as a complete rewrite of jekyll.vim for the Pelican crowd. Also see vim-octopress for further inspirations.
This plugin is packaged for use with Vundle.
Install Vundle and then add 'edthedev/pelican.vim' to your .vimrc.:
Bundle 'edthedev/pelican.vim'
Then, from within Vim, run BundleInstall.:
:BundleInstall
Pelican.vim needs to know where your blog source files will be stored.:
let g:pelican_blog_source = ~/blog_source_files
Pelican.vim also needs to know where you would like the generated HTML files to be placed (locally).:
let g:pelican_blog_html = ~/blog_html_destination
If you store your blog source files in a Git repository, let Pelican.vim manage commits for you:
let g:pelican_git_master = http://github.com/username/blog.git
If you publish your Pelican blog over SSH, tell Pelican.vim the destination location, and it can run a publish command for you:
let g:pelican_publish_server = username@server.domain.com:~/public_html_directory
If you wish to disable the default Pelican.vim keyboard shortcut mappings:
let g:pelican_map_keys = 0
Altogether, the directives added to your ~/.vimrc
should looke a bit like:
Bundle 'edthedev/pelican.vim' let g:pelican_blog_source = '~/blog_source_files' let g:pelican_blog_html = '~/blog_html_destination' let g:pelican_git_master = 'http://github.com/username/blog.git' let g:pelican_publish_server = 'username@server.domain.com:~/public_html_directory'
If your configured g:pelican_blog_source
is already a Git clone of g:pelican_git_master
then you can proceed to using Pelican.vim immediately. If not, see 'Getting Started from Scratch', below.
If necessary, clone your existing blog from your remote Git repository:
:call pelican#clone()
Make sure the files in the directory indicated by g:pelican_blog_source
are up to date from the latest in Git:
:call pelican#pull() or <leader>pu
Open your Pelican content folder (that is, g:pelican_blog_source
), and make some changes to some posts.:
:call pelican#open() or <leader>po
Open your Pelican drafts folder.:
:call pelican#drafts() or <leader>pd
Commit and push your changes back to your remote Git repository. The commit message will always be 'Checking in latest blog changes'.:
:call pelican#commit() or <leader>pc
Generate your blog HTML. This command requires that pelican.conf.py and a 'content' folder exist in folder indicated by g:pelican_blog_source
.:
:call pelican#rst2html() or <leader>ph
Publish your updated HTML content, using Rsync, to your remote web server:
:call pelican#publish() or <leader>pp
Follow these instructions if you are not already using Pelican with Git.
Before the first usage, you may need to install Pelican using one of:
pelican#install() pelican#sudo_install()
Create a new, local Pelican directory, and then push it to the remote Git repository:
:call pelican#initblog()
Configure your new Pelican blog by opening pelicanconf.py
:
pelican#config()
Same as Vim itself, see :help license
.