From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9441 invoked by alias); 14 Nov 2013 01:24:45 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 18144 Received: (qmail 16437 invoked from network); 14 Nov 2013 01:24:41 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) 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,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=JsGfgOXpFA9HKz7MZdJBwECDPrXIJy8I51O5zZD0mdk=; b=sdcodEFRFLSekl46vRzmixpfZVRrtYsK0qpS5x/HgknVTRYuAt6wVanC6AHzcdJ9Uo 5un3BrqQRsyx3ufv9XoI1M8nqSx2uYsD4WUws/oegCGptUJEkvkg84EP7WGgZFiyIG+G BSenfFdnqzMA+aR2LB4KYD5e73tExKjXaR5ccsRPBq0DzSiqKbdXQ5J56QAcyLH2QeSb GuTvkIuXKkhIwqSiDHO56/xccE16Wrh8INno35LKt6tn43Xk4rZMU/eAI6YUEC0cHOnW LrPBZyxnWvZTC35hVtGK16ItRZKErymkklWLXVykh66j/BMtr/6swB9DazIJMYe/b9Ss UzRA== X-Received: by 10.221.16.200 with SMTP id pz8mr599201vcb.53.1384392274894; Wed, 13 Nov 2013 17:24:34 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <131113091326.ZM11728@torch.brasslantern.com> References: <131113091326.ZM11728@torch.brasslantern.com> From: shawn wilson Date: Wed, 13 Nov 2013 20:24:14 -0500 Message-ID: Subject: Re: function to run vim To: Bart Schaefer Cc: Zsh Users Content-Type: text/plain; charset=UTF-8 OK, as i was writing this response, I figured it out (or the solution - I'm just guessing at the problem). But, I think some library got updated and I haven't rebooted / zsh sessions are old. what's weird is that in an old session, I show the same ZSH_PATCHLEVEL as in a new one. I'll have to see if I can figure out what libraries running processes are linked against... Thanks for the reply On Wed, Nov 13, 2013 at 12:13 PM, Bart Schaefer wrote: > On Nov 13, 6:18am, shawn wilson wrote: > } > } A while I made a function so that I could keep one vim session (gvim > } really) and that running 'vim file' would open the file in a new tab > } in that session. Recently, it has stopped working.and I'm not sure > } why. > > What version of zsh is this (and has that changed recently)? What does > > % print $ZSH_PATCHLEVEL > > say? > 1.5778 > Does the function work if you do NOT pass the --remote-tab option? > Didn't test - I assume that would've failed > Are you running vimfunc via an alias? If so, does the behavior change > if you actually type out the full command word "vimfunc ..."? > Yeah, it's an alias so that I can do \vim to actually run plain vim. It does the same thing if I do 'vimfunc file' > Try "functions -t vimfunc" to enable execution tracing and then run the > function in the way that fails. > That's cool, I'll use that.... % vim schroot.conf +vimfunc:1> local cmd +vimfunc:2> local servername +vimfunc:3> local remote +vimfunc:4> local misc +vimfunc:5> local version +vimfunc:7> echo swilson +vimfunc:7> tr '[:lower:]' '[:upper:]' +vimfunc:7> local 'username=SWILSON' +vimfunc:9> local 'opt_ex=^-' +vimfunc:11> [ 1 -gt 0 ']' +vimfunc:12> case schroot.conf (--servername) +vimfunc:12> case schroot.conf (--remote*) +vimfunc:12> case schroot.conf (--version*) +vimfunc:12> case schroot.conf (*) +vimfunc:40> misc=' schroot.conf' +vimfunc:43> shift +vimfunc:11> [ 0 -gt 0 ']' +vimfunc:46> cmd=vim +vimfunc:48> [ '!' -z ']' +vimfunc:51> cmd='vim --servername SWILSON' +vimfunc:54> [ -z ' schroot.conf' ']' +vimfunc:64> [ '!' -z ']' +vimfunc:67> cmd='vim --servername SWILSON --remote-tab schroot.conf' +vimfunc:70> echo 'vim --servername SWILSON --remote-tab schroot.conf' vim --servername SWILSON --remote-tab schroot.conf +vimfunc:71> 'vim --servername SWILSON --remote-tab schroot.conf' vimfunc:71: command not found: vim --servername SWILSON --remote-tab schroot.conf +vimfunc:72> return > By the way, I think you have a typo here: > > } # list version if we asked for that > } if [ ! -z version ] ; then > } cmd="$cmd --version" > } fi > > The [ -z version ] is always going to fail. Needs $version instead. Good catch - I just put that in for completeness and never tested it (obviously)