Better system to display blog in vim
This commit is contained in:
parent
5e8cab96d8
commit
d592f3e378
4 changed files with 37 additions and 1 deletions
19
resources/vim/multi.vim
Normal file
19
resources/vim/multi.vim
Normal 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()
|
17
resources/vim/syntax/ymkd.vim
Normal file
17
resources/vim/syntax/ymkd.vim
Normal 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"
|
|
@ -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')"
|
||||
|
||||
# construct the final filename
|
||||
linkname="$root/latest.md"
|
||||
linkname="$root/latest.ymd"
|
||||
imglinkname="$root/img_latest_blog_dir"
|
||||
blogname="$basefilename"
|
||||
# Uncomment if you prefer use date-title name for url
|
||||
|
|
Loading…
Reference in a new issue