zsh-users
 help / color / mirror / code / Atom feed
From: shawn wilson <ag4ve.us@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: function to run vim
Date: Wed, 13 Nov 2013 20:24:14 -0500	[thread overview]
Message-ID: <CAH_OBie7WdQh0juukHAXRWkDAaObWq2z5Fr4RxXwvkdPeF8JeQ@mail.gmail.com> (raw)
In-Reply-To: <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@brasslantern.com> 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)


      reply	other threads:[~2013-11-14  1:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-13 11:18 shawn wilson
2013-11-13 17:13 ` Bart Schaefer
2013-11-14  1:24   ` shawn wilson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAH_OBie7WdQh0juukHAXRWkDAaObWq2z5Fr4RxXwvkdPeF8JeQ@mail.gmail.com \
    --to=ag4ve.us@gmail.com \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).