Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In pursuit of a better Vim blogging platform #3

Open
wants to merge 56 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
9b6f132
UPdates
Mar 9, 2012
a77b4cc
Updates the Vimblog
Mar 9, 2012
d0c4d04
Merge
Mar 10, 2012
cea489d
Cleans up README
Mar 10, 2012
22e1e24
Update README.md
Mar 10, 2012
b76ef48
Clean error msgs so console VIM plays nice
Mar 10, 2012
0215897
Adds media upload command
Mar 11, 2012
2a1516a
Adds style configuration
Mar 11, 2012
633a751
Cleans category logic; adds error reporting v. silent failure
Mar 11, 2012
92b33fc
Update README.md
Mar 11, 2012
f25bcc1
Update README.md
Mar 11, 2012
00cbe21
Fix raise message
Mar 11, 2012
be74dbb
Clean up args logic
Mar 12, 2012
fc248f1
Tightens URL formatting
Mar 13, 2012
806a6cb
Adds preview on drafts on Mac + Chrome + Wordpress
Mar 14, 2012
1708781
Fetching post now gets content after a more break
Mar 25, 2012
55acc17
Moves configuration to a global dict
Mar 25, 2012
7685215
Adds "view post" support for completed entries
Mar 25, 2012
c38cf50
Updates README
Mar 25, 2012
ed5d249
Removes annoying extra space on delimiter line
Mar 25, 2012
c20733f
Adds a help function.
Apr 1, 2012
da60191
Spelling error is fixed
Apr 1, 2012
ac67b5b
Refactors calculate_date
Apr 1, 2012
7a9a003
Fixes spelling
Apr 1, 2012
19f081d
Removes method that I think is bogus
Apr 1, 2012
7e26721
Adds a nice debugging method
Apr 1, 2012
5d01a77
Remove stray debug data
Apr 1, 2012
ec5b710
Adds a nice debugging method
Apr 1, 2012
8806a90
Merge branch 'master' of github.com:sgharms/vimblog.vim
Apr 1, 2012
aac0d49
Allows multiple categories
Apr 3, 2012
94e8ea0
Update README.md
Apr 3, 2012
41a50f5
Merge branch 'master' of github.com:sgharms/vimblog.vim
Apr 3, 2012
1fcbfd4
Adds vim-help documentation
Apr 9, 2012
5b424c2
Move to using a proper syntax highlight config
Apr 9, 2012
29f9a62
Remove some cruft
Apr 9, 2012
7e64fe0
Implements highlighting options from config dict
Apr 9, 2012
b4998c8
Rescoped functions
Apr 9, 2012
4101f04
Adds a help function.
Apr 9, 2012
07439af
Spelling error is fixed
Apr 9, 2012
a42a836
Refactors calculate_date
Apr 9, 2012
5b6e7e5
Fixes spelling
Apr 9, 2012
8e41b77
Removes method that I think is bogus
Apr 9, 2012
807fb17
Adds a nice debugging method
Apr 9, 2012
86b396a
Remove stray debug data
Apr 9, 2012
1e733fc
Allows multiple categories
Apr 9, 2012
bb09b95
Update README.md
Apr 9, 2012
c91b614
Adds vim-help documentation
Apr 9, 2012
705b807
Move to using a proper syntax highlight config
Apr 9, 2012
8e5216f
Remove some cruft
Apr 9, 2012
f66fdf6
Implements highlighting options from config dict
Apr 9, 2012
300c313
Rescoped functions
Apr 9, 2012
9bec786
Merge branch 'master' of github.com:sgharms/vimblog.vim
Apr 9, 2012
4853e9d
Adds file detect; syntax highlight
Apr 9, 2012
68095c1
Update README.md
Apr 23, 2012
859da9b
Cleaned up README form vestigial bad steps.
Apr 23, 2012
e638da1
Provides debug function
Apr 23, 2012
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 0 additions & 71 deletions README

This file was deleted.

105 changes: 105 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# VIMBLOG.VIM

## Description

For Vi, Vim or GVim users, there is a simple way to manage your blog
posts.

In the Vim environment you can now:

* create new blog posts
* edit / posts
* list all categories
* list older posts
* Promote turn "draft" posts into "published" (and vice-versa)
* Upload media to your blog from within VIM and get a link to it
* *Mac+Wordpress+Chrome*: After using `:Blog draft` you can preview
your draft with `<Leader>p`, `\\p` by default. Additionally, if you
access a pre-existing post (`Blog rp`, then `<CR>` on a line with the ID
in it), thereafter `\\p` will launch the entry in Chrome.

In short, if you've been hanging on to Textmate for its blogging bundle,
you now have a comparable featureset in Vim thanks to Vimblog and
[GIFL](http://github.com/sgharms/gifl).

It is an out-of-the-box solution that works for Wordpress, but which can
very easilly, be customized to manage Blogger, MovableType, TextPattern,
et al. Its the beauty of Open Source software. Study the code, change
it, and use it. It is very safe to use it because unlike proprietary
software, you can check for "phone\_home" procedures, etc.

## Requirements:

1. You'll need VIM compiled with Ruby scripting support. Check for
this by executing `vim --version|grep ruby`. My result ([MacVim +
Janus](https://github.com/carlhuda/janus)) shows: `+reltime +rightleft +ruby +scrollbind +signs +smartindent -sniff +startuptime`. This means that I have ruby scripting support compiled. Debian/Ubuntu can install Ruby support with: `sudo apt-get install vim-ruby`
1. To install you several options:
1. Copy this file to one of your VIM directories
1. *Pure Vim Example*: copy the script file to your .vim home folder: $HOME/.vim/vimlog.vim
1. *Pathogen Example*: If you're using [Tim Pope's
Pathogen](http://www.vim.org/scripts/script.php?script_id=2332),
go to your Pathogen root directory and then `git clone` this repository
1. *Janus Example*: If you're using Janus then you're just a
variation on the Pathogen setup. Create a `~/.janus` directory
and then add this repository as a submodule with `git submodule add
$GIT_REPO_PATH vimblog`. Git will check out the plugin for you as a
[git submodule](http://book.git-scm.com/5_submodules.html)
1. Your VIM runtime must be made aware of this plugin by means of the
following command. Make sure it is in your `~/.vimrc` or, for
MacVim + Janus users, make sure it is in `~/.vimrc.after`

if !exists('\*Wordpress\_vim')
runtime vimblog.vim
endif

1. Update your configuration credentials as described in the next section
1. After completing configuration, you can verify your installation by opening vim, and executing `:Blog rp` to get your
recent 10 posts. If you see them, then congratulations, you're ready to go.

## Configuration

**YOU MUST** define the following global in your `.vimrc`.

let g:vimblogConfig = {'login': '*username*', 'passwd': '*pw*', 'site': '*yoursite*', 'xml_rpc_path': '/xmlrpc.php', 'port': '80', 'image_style': '*classes you want to add to images*', additional_ft': *additional filetypes that a vimblog should syntax highlight with e.g. (markdown|textile|html) - if unset, vimblog buffers will only have 'vimblog' highlighting }

I put mine like so:

let g:vimblogConfig = { ... my configuration dictionary ...}
if !exists('\*Wordpress\_vim')
runtime vimblog.vim
endif

`image_style` : This will provide CSS classes that are applied to the
`<img>` tags that result from using the media upload function.
Typically you would add `centered` or `featured-image`.

Use of this configuration dictionary allows the configuration and the
code to be separated.

## Troubleshooting

### "That Didn't Work"
1. Check if the script is being found, by typing :B + TAB key. Upon code completion, it is ok. Remember, capital B.
1. If the error persist, check for the correct path for xmlrpc.php in @xml value.
1. Open an issue on github

## LICENSE:

Copyright (c) 2007 pedro mg

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
75 changes: 75 additions & 0 deletions doc/vimblog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
*vimblog.vim* : Plugin for blogging from within Vim

#===============================================================================
*vimblog-author*
Original Author: Pedro MG
Major Upgrate: Steven G. Harms <steven.harms@gmail.com>
#===============================================================================

CONTENTS *vimblog-contents*

|vimblog-about| Introduction
|vimblog-configuration| Configuration
|vimblog-usage| Usage

ABOUT VIMBLOG *vimblog-about*

For Vi, Vim or GVim users, there is a simple way to manage your blog
posts.

In the Vim environment you can now:

* Create new blog posts
* Edit / posts
* List all categories
* List older posts
* Promote turn "draft" posts into "published" (and vice-versa)
* Upload media to your blog from within VIM and get a link to it
* Mac+Wordpress+Chrome: After using :Blog draft you can preview
your draft with <Leader>p, \p by default. Additionally, if you
access a pre-existing post (Blog rp, then <CR> on a line with the ID
in it), thereafter \p will launch the entry in Chrome.

In short, if you've been hanging on to Textmate for its blogging bundle,
you now have a comparable featureset in Vim thanks to Vimblog and
|GIFL|.

It is an out-of-the-box solution that works for Wordpress, but which can
very easilly, be customized to manage Blogger, MovableType, TextPattern,
et al. Its the beauty of Open Source software. Study the code, change
it, and use it. It is very safe to use it because unlike proprietary
software, you can check for "phone\_home" procedures, etc.

VIMBLOG CONFIGURATION *vimblog-configuration*
*g:vimblogConfig*

You must define the configuration in your ~/.vimrc by defining a
dictionary (aka a Hash) called g:vimblogConfig.


g:vimblogConfig = {
'login': '*username*',
'passwd': '*pw*',
'site': '*yoursite*',
'xml_rpc_path': '/xmlrpc.php',
'port': '80',
'image_style': '*classes you want to add to images*'
}


USING VIMBLOG *vimblog-usage*

Vimblog functions are invoked from the : prompt and the keyword
"Blog". Thus :Blog np will allow you to create a new post, :Blog rp
will fetch recent posts. :Blog help will also display this help menu.

:blog rp [x] => show recent [x] posts"
:blog gp id => get post with identification id"
:blog np => create a new post"
:blog um file => upload media asset [path to asset]"
:blog publish => publish an edited/new post"
:blog draft => save edited/new post as draft"
:blog gc => get the list of categories"
:blog del id => delete post with identification id"
:blog help => this message"

1 change: 1 addition & 0 deletions ftdetect/vimblog.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
au BufNewFile,BufRead *.blog set filetype=vimblog
Loading