Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: function to run vim
- X-seq: zsh-users 18144
- From: shawn wilson <ag4ve.us@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: function to run vim
- Date: Wed, 13 Nov 2013 20:24:14 -0500
- Cc: Zsh Users <zsh-users@xxxxxxx>
- 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==
- In-reply-to: <131113091326.ZM11728@torch.brasslantern.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAH_OBicAK=-Kkz9b8T9oDZAgvb+DWToUMSVh2oN2fx_WBioRgQ@mail.gmail.com> <131113091326.ZM11728@torch.brasslantern.com>
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
<schaefer@xxxxxxxxxxxxxxxx> 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)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author