|
From: | Thomas Dickey |
Subject: | Re: [vile] Using '\' char in key bindings |
Date: | Sat, 25 Sep 2010 16:25:08 -0400 (EDT) |
On Sat, 25 Sep 2010, address@hidden wrote:
I'm curious as to why this happened? I assume it was the '\' char that requires the double quotes so is there something special about backslash? More specifically what escape functionality exists on the right hand side of key bindings, if it does exist?
in scripts - http://invisible-island.net/vile/macros.html#strings-id I mostly use single-quoted strings in macros since they're simpler.
Also, I've been reading the vileinit.rc from the distribution and I have a question about procedures. Is there a way to pass them arguments and have some type of $1 $2 $N expansions in the procedure? If not is there a way to achieve this with setting some type of user variable prior to calling the procedure?
yes - it supports $1, etc. http://invisible-island.net/vile/macros.html#named-id Parameters can be typed, so that vile can prompt for missing parameters and do it in a sensible manner.Generally speaking, user-variables are "global". However the macros support a directive named "~local" which can save/restore variables on an internal stack to avoid conflict. (There's no way to access the stack
from a script).
Thanks again, Wayne On Fri, Sep 24, 2010 at 05:12:50PM -0400, Thomas Dickey wrote:On Fri, 24 Sep 2010, address@hidden wrote:I can interactively set this key binding. bind-key paste-from-primary ^X-\ And the binding works. However if I place that line in my .vilerc and start xvile I get the following error message:I see how to make it work. What I did was :show-history and saw that it was stored as bind-key paste-from-primary "^X-\\" and sourcing that seems to work (no error messages, etc).[Not a proper key-sequence] I've tried doubling the '\' in case it is being interpreted as an escape character, same result.In a script, vile recognizes quoted strings (double- and single-quotes), and those are supposed to match(*) the way the history mechanism saves/restores tokens. Interactively, it translates to/from that form. (*) if it doesn't, that's a bug of course -- Thomas E. Dickey http://invisible-island.net ftp://invisible-island.net_______________________________________________ vile mailing list address@hidden http://lists.nongnu.org/mailman/listinfo/vile
-- Thomas E. Dickey http://invisible-island.net ftp://invisible-island.net
[Prev in Thread] | Current Thread | [Next in Thread] |