From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1128 invoked by alias); 12 Jul 2015 07:02:59 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 35775 Received: (qmail 7436 invoked from network); 12 Jul 2015 07:02:55 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=/U3yNBzRL3wJlWN6apylZyGXNpo=; b=Fwg8cQ L+aXdB8LglAZ9r5pVwHJT4fGvuc4y6/I0hS1It2q6pq2a8+G3eZAKXijSb4STe16 8RFbisK2kU2eH9rB0oerCn9gYxLGLnRLibMmTBrIZ8HWv0YfvY3yqDLPshK0FLNd fVvh4ZaibCS4lBTYfXZP6W/sEg8J/AAjIjbXM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=/U3yNBzRL3wJlWN6apylZyGXNpo=; b=YA46K wanHAF3jf4OcNcLc/Rr62BWyR6Y7KnY1Rz1f9JktS37uwO3IAnseqUjurkaWZ8Vz EMLrCEQN7lHIMAn3UK2aGd6L/V8Dn7BPa0r92+L8RZzg0PE7NOf8o5+XA5CcBWoS RmYj4QiR/w6NlFK6aMhzuIwSbMsutQDe/p7qv8= X-Sasl-enc: UaiWgOgga6u6lA31znnezQdvq4VjRRHzaMBvnkXcXVSr 1436683921 Date: Sun, 12 Jul 2015 06:51:59 +0000 From: Daniel Shahaf To: Bart Schaefer Cc: zsh-workers@zsh.org Subject: [PATCH] Re: Vim yodl syntax highlighting Message-ID: <20150712065159.GG1945@tarsus.local2> References: <20150706141233.GG2165@tarsus.local2> <150706153158.ZM4229@torch.brasslantern.com> <20150710181428.GH1869@tarsus.local2> <150710170134.ZM10499@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="3MwIy2ne0vdjdPXF" Content-Disposition: inline In-Reply-To: <150710170134.ZM10499@torch.brasslantern.com> User-Agent: Mutt/1.5.21 (2010-09-15) --3MwIy2ne0vdjdPXF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Bart Schaefer wrote on Fri, Jul 10, 2015 at 17:01:34 -0700: > If you can't jam it all in a .vimrc or the like, it should probably go > in Util/ rather than Doc/. Attached. It's autoloading for those people who auto-source $PWD/.vimrc, and there are instructions for everyone else. (The "install permanently" part could be further streamlined.) --3MwIy2ne0vdjdPXF Content-Type: text/x-patch; charset=us-ascii Content-Disposition: attachment; filename="0001-New-zsh-specific-yodl-vim-syntax-highlighting.patch" >>From 4d90d8bf5a8ca51879fe3a6f2ca53969668cf349 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sat, 11 Jul 2015 09:18:20 +0000 Subject: [PATCH] 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. --- Doc/Zsh/.vimrc | 4 +++ Etc/zsh-development-guide | 3 ++ Util/zyodl.vim | 74 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 Doc/Zsh/.vimrc create mode 100644 Util/zyodl.vim diff --git a/Doc/Zsh/.vimrc b/Doc/Zsh/.vimrc new file mode 100644 index 0000000..6544cd4 --- /dev/null +++ b/Doc/Zsh/.vimrc @@ -0,0 +1,4 @@ +augroup filetypedetect + autocmd BufRead,BufNewFile **/Doc/Zsh/*.yo set ft=zyodl | source :h:h:h/Util/zyodl.vim + "autocmd BufRead,BufNewFile **/Etc/FAQ.yo set ft=zyodl | source :h:h:h/Util/zyodl.vim +augroup END diff --git a/Etc/zsh-development-guide b/Etc/zsh-development-guide index d92b724..4d6cefd 100644 --- a/Etc/zsh-development-guide +++ b/Etc/zsh-development-guide @@ -920,6 +920,9 @@ Documentation surrounding text. No extra newlines after the opening or before the closing parenthesis are required. +A syntax highlighting file for Vim is included, just source tt(Doc/Zsh/.vimrc) +before editing one of the Doc/Zsh/*.yo files. + Module names ------------ diff --git a/Util/zyodl.vim b/Util/zyodl.vim new file mode 100644 index 0000000..db2a599 --- /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="\