1
0
mirror of https://github.com/gryf/.vim.git synced 2026-02-01 07:05:48 +01:00

Added vimblogger_ft, update for lucius colorscheme and pyflakes plugin

This commit is contained in:
2010-12-27 21:59:24 +01:00
parent a4fad23f26
commit 90fd776dc2
15 changed files with 1234 additions and 300 deletions

View File

@@ -126,16 +126,9 @@
:VimwikiToggleListItem vimwiki.txt /*:VimwikiToggleListItem*
:VimwikiUISelect vimwiki.txt /*:VimwikiUISelect*
:VimwikiVSplitLink vimwiki.txt /*:VimwikiVSplitLink*
AnsiEsc AnsiEsc.txt /*AnsiEsc*
AnsiEsc-contents AnsiEsc.txt /*AnsiEsc-contents*
AnsiEsc-copyright AnsiEsc.txt /*AnsiEsc-copyright*
AnsiEsc-history AnsiEsc.txt /*AnsiEsc-history*
AnsiEsc-manual AnsiEsc.txt /*AnsiEsc-manual*
AnsiEsc.txt AnsiEsc.txt /*AnsiEsc.txt*
ExtractSnips() snipMate.txt /*ExtractSnips()*
ExtractSnipsFile() snipMate.txt /*ExtractSnipsFile()*
Filename() snipMate.txt /*Filename()*
Id vimblogger_ft.txt /*Id*
ResetSnippets() snipMate.txt /*ResetSnippets()*
ShowMarksClearAll showmarks.txt /*ShowMarksClearAll*
ShowMarksClearMark showmarks.txt /*ShowMarksClearMark*
@@ -276,6 +269,7 @@ g:blogger_login vimblogger_ft.txt /*g:blogger_login*
g:blogger_maxarticles vimblogger_ft.txt /*g:blogger_maxarticles*
g:blogger_name vimblogger_ft.txt /*g:blogger_name*
g:blogger_pass vimblogger_ft.txt /*g:blogger_pass*
g:blogger_pygments_class vimblogger_ft.txt /*g:blogger_pygments_class*
g:blogger_stylesheets vimblogger_ft.txt /*g:blogger_stylesheets*
g:fuf_abbrevMap fuf.txt /*g:fuf_abbrevMap*
g:fuf_autoPreview fuf.txt /*g:fuf_autoPreview*

View File

@@ -1,4 +1,4 @@
*vimblogger_ft.txt* reStructuredText to Blogger Interface
*vimblogger_ft.txt* reStructuredText to Blogger interface
Author: Roman Dobosz, gryf73 at gmail com
Simple interface to create blog articles in rsST format. It provides
@@ -15,24 +15,50 @@ Other requirements:
- Python (tested with version 2.6, should work also in others)
- gdata http://code.google.com/p/gdata-python-client
- docutils http://docutils.sourceforge.net
- pygments http://pygments.org (optional)
- Pygments http://pygments.org (optional)
- Blogger account
-----------------------------------------------------------------------
Install~
Extract zip file into your ~/.vim.
Edit the vba file and type: >
:so %
========================================================================
Usage~
This plugin is targeting for people, who has blogger account, want to
use vim for creating blog articles and don't really likes to manually do
use VIm for creating blog articles and don't really likes to manually do
this in html.
Unfortunately it has several limitations, like you cannot use multiple
blogs or edit existing articles without reST source files. You have to
somehow convert it reStructuredText, add *Id* and then update it.
Before starting writing a post, at least |g:blogger_name| and
|g:blogger_login| has to be set up in |.vimrc|. Next, an article has to
be written using standard reST markup, |:Title:| added (not required,
but it's nice to have some title for a blog entry). Now,
|:PreviewBlogArticle| can be used for saving generated HTML page into
the file of the same name as reST file. Please note, that it'll silently
overwrite existing file, because it is treated as a temporary file.
When article is done, |:SendBlogArticle| will send it to the server.
Output provided by |:PreviewBlogArticle| without any
css stylesheet will look pretty raw, so it is generally good idea to
grab stylesheets from blog itself, tweak it a little, and add to list
in |g:blogger_stylesheets|. They will be automatically linked to
generated preview file.
Unfortunately, this script has several limitations, like it is
impossible to use multiple blogs or edit existing articles without reST
source files. It has to be somehow converted to reStructuredText, id of
an article added to |:Id:| docinfo item and then updated. Id of an
article is available through blogger account - every action for each
post listed on Posting->Edit Posts has URL with query string item
postID, for example:
>
http://www.blogger.com/post-edit.g?blogID=9876&postID=12345
<
-----------------------------------------------------------------------
Options~
@@ -45,10 +71,10 @@ g:blogger_browser (default: 0)
*g:blogger_name*
g:blogger_name (default: "")
This is blog name, which is part of the URL, and you was obligated
to enter it during blog creation. If you don't remember it, just
check first part od the URL of your blog, just after 'http://'.
Don't be confused with the blog title.
This is blog name, which is part of the URL, and user was obligated
to enter it during blog creation. If in doubt, check first part od
the URL of the blog, just after 'http://'. Note, that blog name may
differ from the blog title, but also could be the same.
*g:blogger_login*
g:blogger_login (default: "")
@@ -57,8 +83,8 @@ g:blogger_login (default: "")
*g:blogger_pass*
g:blogger_pass (default: "")
Password. If set to empty string, You'll be asked for it every time
you do any blogger activity.
Password. If set to empty string, user will be asked for it every
time if any blogger connectivity is performed.
*g:blogger_draft*
g:blogger_draft (default: 1)
@@ -84,6 +110,12 @@ g:blogger_stylesheets (default: [])
one wanted to save stylesheets from his own blog, so that article
can be displayed almost in the same way as in blog.
*g:blogger_pygments_class*
g:blogger_pygments_class (default: "")
Name of default CSS class for usage with Pygments. When not
provided or empty, it'll use defaults from Pygments: "highlight".
========================================================================
Commands~
@@ -110,33 +142,32 @@ Commands~
reST document structure~
It is assumed, that following template will be used:
-----8<-----
:Id:
:Title: Title for the blog
:Date:
:Modified:
:Tags: some, tags
Penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla
facilisis massa ut massa. Sed nisi purus, malesuada eu, porta vulputate,
suscipit auctor, nunc. Vestibulum convallis, augue eu luctus malesuada,
mi ante mattis odio, ac venenatis neque sem vitae nisi.
.. more
heading
-------
**Congue** mi, quis posuere augue nulla a augue. Pellentesque sed est.
Mauris cursus urna id lectus. Integer dignissim feugiat eros. Sed tempor
volutpat dolor. Vestibulum vel lectus nec mauris semper adipiscing.
Aliquam tincidunt enim sit amet tellus. Sed mauris nulla, semper
tincidunt, luctus a, sodales eget, leo. Sed ligula augue, cursus et.
----->8-----
>
:Id:
:Title: Title for the blog article
:Date:
:Modified:
:Tags: some, tags
Penatibus et magnis dis parturient montes, nascetur ridiculus mus.
Nulla facilisis massa ut massa. Sed nisi purus, malesuada eu, porta
vulputate, suscipit auctor, nunc. Vestibulum convallis, augue eu luctus
malesuada, mi ante mattis odio, ac venenatis neque sem vitae nisi.
.. more
heading
-------
**Congue** mi, quis posuere augue nulla a augue. Pellentesque sed est.
Mauris cursus urna id lectus. Integer dignissim feugiat eros. Sed
tempor volutpat dolor. Vestibulum vel lectus nec mauris semper
adipiscing.
Aliquam tincidunt enim sit amet tellus. Sed mauris nulla, semper
tincidunt, luctus a, sodales eget, leo. Sed ligula augue, cursus et.
<
reST document (optionally) starts with *docinfo* section (first several
lines, that are starting from ":" character) separaded from other
content with one empty line.
@@ -173,18 +204,69 @@ All other items are ignored.
After docinfo block, article body should be placed using markup for
reStructuredText.
Additionally, if pytgments is installed, there is sourcecode directive, simple
syntax highlighter using Pygments module. Very simple usage could be as
follows:
Note, that `.. more' will became HTML comment `<!-- more -->' which will
prevent from displaying entire post on the bloggers front page, but will
not have any visible effect during preview in browser.
-----8<-----
.. sourcecode:: python
========================================================================
Pygments code highlighting~
import vim
print vim.current.buffer.name
Additionally, if Pygments is installed, there is ``sourcecode``
directive, simple syntax highlighter using Pygments module. Very simple
usage for Python code could be as follows:
>
.. sourcecode:: python
import vim
print vim.current.buffer.name
<
Note, that `sourcecode' directive requires argument with the name of the
lexer to use. If wrong/non existent lexer is provided, it will fall back
to `text' lexer. For more information about available lexers, please
refer to Pygments documentation.
----->8-----
Directive `sourcecode' supports two options: `:linenos:' and
`:cssclass:'.
`:linenos:' takes zero or one argument - if no arguments is provided,
line numbers will be visible starting form 1. Provided integer will be
the number of the first line.
`:cssclass:' can be use for changing default class name for block of
code. Default class can be changed by appropriate option for plugin
(see documentation), and defaults to "highlight".
It is possible to use VIm colorschemes like desert (which is distributed
with VIm), Zenburn, Lucius, Wombat, inkpot or any other with Pygments.
Assuming, that colorscheme `desert' should be used, there are two steps
to achive it.
First, python module containing Pygments `Style' class has to be
generated. There is appropriate conversion tool in Pygments
distribution - `scripts/vim2pygments.py'. Uage is simple as:
>
python Pygments/scripts/vim2pygments.py \
path/to/vim/colors/desert.vim > desert.py
<
Which will create new python module ``desert.py`` containing class
`DessertStyle`'.
To generate CSS stylesheet, it's enough to:
>
python rst2blogger/scripts/style2css.py desert.py \
-c VimDesert > desert.css
<
VimDesert is the name of the class, which passed as an argument to
`:cssclass:' option of directive `sourceocode'. It will be used as a
main CSS class for code top `<div>' element. So, above example will
looks like this:
>
.. sourcecode:: python
:cssclass: VimDesert
import vim
print vim.current.buffer.name
<
Note: All headings for generated HTML by |:SendBlogArticle| will be
shifted by 3, so the first heading will become <h3>, second <h4> and so
on, to fit into blogger template (well, most of them). Remember, that
@@ -194,6 +276,7 @@ limitation.
========================================================================
Changelog~
0.2 Pygments sourcecode directive improvements
0.1 First release
vim:tw=72:fo=tcq2:isk=!-~,^*,^|,^":ts=8:ft=help:norl: