From ca2ab5e446bcf40e18de4390ee1b47c8295b5728 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sat, 11 Jul 2015 09:18:20 +0000 Subject: 35775: New zsh-specific yodl vim syntax highlighting. To try this, see the instructions at the top of Util/zyodl.vim (in the comment). * Util/zyodl.vim: New syntax highlighting file. * Doc/Zsh/.vimrc: New file, hooks up zyodl.vim for automatic loading. * Etc/zsh-development-guide: Namedrop zyodl.vim for discoverability. --- Util/zyodl.vim | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 Util/zyodl.vim (limited to 'Util') diff --git a/Util/zyodl.vim b/Util/zyodl.vim new file mode 100644 index 000000000..db2a599ca --- /dev/null +++ b/Util/zyodl.vim @@ -0,0 +1,74 @@ + +"" A Vim syntax highlighting file for Doc/Zsh/*.yo + +" To try this, run: +" cd Doc/Zsh && vim --cmd "source ./.vimrc" zle.yo +" (This sources the file .) +" +" To install this permanently: +" 1. Copy this file to ~/.vim/syntax/zyodl.vim +" 2. Create ~/.vim/filetype.vim as explained in ":help new-filetype" case C. +" 3. Add the following command to ~/.vim/filetype.vim: +" autocmd BufRead,BufNewFile **/Doc/Zsh/*.yo setfiletype zyodl + +"" Test case: +" texinode()()()() +" chapter(foo) +" vindex(foo) +" foo tt(foo) var(foo) bf(foo) em(foo) foo +" xitem(foo) +" item(foo)(foo) +" sitem(foo)(foo foo) +" example(print *.c+LPAR()#q:s/#%+LPAR()#b+RPAR()s+LPAR()*+RPAR().c/'S${match[1]}.C'/+RPAR()) +" ifzman(zmanref(zshmisc))ifnzman(noderef(Redirection)) +" LPAR()foo 42 foo+RPAR() +" +" chapter(foo (foo) foo) # nested parentheses +" sitem(foo)(foo tt(foo) foo) # nested underline + +if exists("b:current_syntax") + finish +endif + +"" Syntax groups: +syn clear +syn cluster zyodlInline contains=zyodlTt,zyodlVar,zyodlBold,zyodlEmph,zyodlCond +syn region zyodlTt start="\