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
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Adds a help function.
Steven G. Harms committed Apr 9, 2012
commit 4101f04e9eb6f3620b2f9fe67d0f1fb63b9985d5
56 changes: 39 additions & 17 deletions plugin/vimblog.vim
Original file line number Diff line number Diff line change
@@ -37,6 +37,23 @@ endfunction
" }}} 1

" Auxilary Ruby commands{{{ 2

"{{{3
function! BlogHelp()
echo "Usage is :Blog option [arg]"
echo " switches:"
echo " - rp [x] => show recent [x] posts"
echo " - gp id => get post with identification id"
echo " - np => create a new post"
echo " - um file => upload media asset [path to asset]"
echo " - publish => publish an edited/new post"
echo " - draft => save edited/new post as draft"
echo " - gc => get the list of categories"
echo " - del id => delete post with identification id"
echo " - help => this message"
endfunction
"}}}3

function! CloseQuickfixAndOpenaPost(id) " {{{3
cclose
new
@@ -110,10 +127,14 @@ function! Wordpress_vim(start, ...) " {{{1
endif

call Blog_syn_hl() " comment out if you don't wish syntax highlight activation
" }}}1

try
" {{{1
ruby <<EOF
require 'xmlrpc/client.rb'
require 'time.rb'
require 'xmlrpc/client'
require 'time'
require 'date'
class Wp_vim

#######
@@ -133,10 +154,14 @@ ruby <<EOF
rescue XMLRPC::FaultException => e
xmlrpc_flt_xcptn(e)
rescue => ex
VIM::command("echo \"Unhandled Error: #{ex} and #{ex.backtrace}\"")
VIM::command("echo \"Unhandled Error: #{ex.to_s} and #{ex.backtrace.join('*')}\"")
end
end

def blog_help(args)
blog_api('help')
end

def method_missing(sym, *args)
VIM.command("echo \"Vimblog fatal error: unable to resolve #{sym.to_s} with #{args}\"")
end
@@ -201,7 +226,7 @@ ruby <<EOF
end
end

#######
#######"{{{
# upload a media asset. Returns the URL to the file
#
def blog_um(args)
@@ -422,6 +447,9 @@ ruby <<EOF
result = @blog.call *args
return result

when "help"
VIM::command("throw \"help\"")

when "cl"
resp = @blog.call("mt.getCategoryList", @blog_id, @login, @passwd)
arr_hash = []
@@ -468,6 +496,8 @@ ruby <<EOF
end # class Wp_vim
Wp_vim.new(VIM::evaluate("a:start"), (VIM::evaluate("a:0") > 0 ? VIM::evaluate("a:000") : '' ))
EOF
" }}} 1
" {{{ 1
catch /del/
:echo "Usage for deleting a post:"
:echo " :Blog del id"
@@ -492,19 +522,11 @@ EOF
catch /um/
:echo "Usage for Upload Media"
:echo " :Blog um [filename]"
catch //
:echo "Usage is :Blog option [arg]"
:echo " switches:"
:echo " - rp [x] => show recent [x] posts"
:echo " - gp id => get post with identification id"
:echo " - np => create a new post"
:echo " - um [f] => upload media asset [path to asset]"
:echo " - publish => publish an edited/new post"
:echo " - draft => save edited/new post as draft"
:echo " - gc => get the list of categories"
:echo " - del id => delete post with identification id"
:echo " --- syntax helpers:"
:echo " - link ADDRESS,TITLE,STRING => insert link <a href='ADDRESS' title='TITLE'>STRING</a> link"
catch /help/
call BlogHelp()
catch /(.*)/
:echo v:exception
call BlogHelp()
endtry
endfunction
" }}}1