Better system to display blog in vim

This commit is contained in:
Yann Esposito (Yogsototh) 2011-09-30 14:23:27 +02:00
parent 5e8cab96d8
commit d592f3e378
4 changed files with 37 additions and 1 deletions

19
resources/vim/multi.vim Normal file
View file

@ -0,0 +1,19 @@
" Very specific for my blog posts
" Most people should delete this part
" If you want to see what it does, simply
" edit a file named latest.ymd and start some lines with 'fr: '
" and 'en: '.
" I use this to maintain a two langage parallel markdown files.
function! YMarkDown()
set foldenable
set foldlevel=0
set foldminlines=0
set foldmethod=expr
set foldtext=''
set scrollbind
set foldexpr=getline(v:lnum)=~'^en:\ .*$'
vsplit
set foldexpr=getline(v:lnum)=~'^fr:\ .*$'
set spell
endfunction
autocmd BufRead *.ymd call YMarkDown()

View file

@ -0,0 +1,17 @@
" Vim syntax file
" Language: Nanoc Markdown
" Read the HTML syntax to start with
runtime! syntax/markdown.vim
unlet! b:current_syntax
syn region erbBlock start=/<%=/ end=/%>/
" YAML region
syn region yamlBlock start=/-----/ end=/-----/
syn region codeBlock start=/<code/ end=/<\/code>/
hi def link yamlBlock Comment
hi def link codeBlock Special
syn match ylang "^..: "
hi def link ylang PreProc
let b:current_syntax = "ymkd"

View file

@ -22,7 +22,7 @@ image_blog_dir="$root/output/Scratch/img/blog"
basefilename="$( print $title | perl -pe 'chomp(); s#ç#c#g; s#àâ#a#g; s#éèê#e#g; s#ô#o#g; s#û#u#g; s#\W#-#g')" basefilename="$( print $title | perl -pe 'chomp(); s#ç#c#g; s#àâ#a#g; s#éèê#e#g; s#ô#o#g; s#û#u#g; s#\W#-#g')"
# construct the final filename # construct the final filename
linkname="$root/latest.md" linkname="$root/latest.ymd"
imglinkname="$root/img_latest_blog_dir" imglinkname="$root/img_latest_blog_dir"
blogname="$basefilename" blogname="$basefilename"
# Uncomment if you prefer use date-title name for url # Uncomment if you prefer use date-title name for url