Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #4 from sudar/syntax

Looks good. Thx @sudar
  • Loading branch information...
commit 0355e96fafdedbbda15821feb2a758809a7c846e 2 parents ca6273d + e80f3bc
@pentie authored
View
8 plugin/vimrepress.py
@@ -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))
View
1  syntax/blogsyntax.vim → syntax/html_blogsyntax.vim
@@ -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
13 syntax/md_blogsyntax.vim
@@ -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"
Please sign in to comment.
Something went wrong with that request. Please try again.