/vim-draftin

vim plugin for https://draftin.com

Primary LanguageVim ScriptMIT LicenseMIT

vim-draftin

Work in progress plugin for the excellent writing tool https://draftin.com

Dependencies

When creating/uploading a document the first time, a JSON response is received. To parse this and extract the id, vim-scripts/ParseJSON is used.

If the text/content contains certain characters (e.g. if you write about code), they may have to be escaped in JSON. vim-scripts/jsoncodecs.vim handles this.

vim-draftin uses the program curl to send messages to draftin.com. How to install it will depend on your system.

Installation

git clone https://github.com/bartek/vim-draftin ~/.vim/bundle/vim-draftin
Plugin 'bartek/vim-draftin'
NeoBundle 'bartek/vim-draftin'

Configuration

You'll need to set your https://draftin.com credentials to be able to POST new documents. Within .vimrc (or in a file sourced from .vimrc):

let g:draftin_auth = "username:password"

Usage

  • :Draft will upload the document to Draft, echo'ing back the url. Arguments to the command will be used as the name of the document. If there are no arguments, the name will be set to the first line of the content, or if that is missing too, the file name.
  • :DraftRename <New name> will rename an existing Draft document to 'New name'