Permalink
Browse files

Merge pull request #4 from sudar/syntax

Looks good. Thx @sudar
  • Loading branch information...
pentie committed Apr 26, 2013
2 parents ca6273d + e80f3bc commit 0355e96fafdedbbda15821feb2a758809a7c846e
Showing with 19 additions and 3 deletions.
  1. +5 −3 plugin/vimrepress.py
  2. +1 −0 syntax/{blogsyntax.vim → html_blogsyntax.vim}
  3. +13 −0 syntax/md_blogsyntax.vim
View
@@ -461,9 +461,11 @@ def refresh_from_wp(self, post_id):
if field["key"] == G.CUSTOM_FIELD_KEY:
meta['editformat'] = "Markdown"
self.raw_text = content = field["value"]
+ vim.command('setl syntax=md_blogsyntax')
break
else:
self.raw_text = content
+ vim.command('setl syntax=html_blogsyntax')
meta["content"] = content
@@ -611,7 +613,7 @@ def blog_wise_open_view():
vim.command('setl nomodified')
else:
vim.command(":new")
- vim.command('setl syntax=blogsyntax')
+ vim.command('setl syntax=md_blogsyntax')
vim.command('setl completefunc=vimrepress#CateComplete')
@@ -908,7 +910,7 @@ def blog_guess_open(what):
if blog_index != -1:
guess_id = re.search(r"\S+?p=(\d+)$", what)
- # permantlinks
+ # permalinks
if guess_id is None:
# try again for /archives/%post_id%
@@ -935,7 +937,7 @@ def blog_guess_open(what):
if blog_index != -1 and blog_index != g_data.conf_index:
blog_config_switch(blog_index)
- # Uesr input something not a usabe url, try numberic
+ # User input not a url, try numeric
else:
try:
post_id = str(int(what))
@@ -3,6 +3,7 @@ if version < 600
elseif exists("b:current_syntax")
finish
endif
+runtime! syntax/html.vim
sy match blogeditorEntry "^ *[0-9]*\t.*$"
sy match blogeditorComment '^".*$'
sy match blogeditorIdent '^"[^:]*:'
View
@@ -0,0 +1,13 @@
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+runtime! syntax/markdown.vim
+sy match blogeditorEntry "^ *[0-9]*\t.*$"
+sy match blogeditorComment '^".*$'
+sy match blogeditorIdent '^"[^:]*:'
+hi link blogeditorComment Comment
+hi link blogeditorEntry Directory
+hi link blogeditorIdent Function
+let b:current_syntax = "blogsyntax"

0 comments on commit 0355e96

Please sign in to comment.