Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: list bindings with given prefix.



On Apr 1,  4:11pm, Oliver Kiddle wrote:
} Subject: Re: PATCH: list bindings with given prefix.
}
} Peter Stephenson wrote:
} > 
} > This allows `bindkey -p <seq>' to list bindings which have <seq> as a
} > prefix (not counting bindings for <seq> itself).
} 
} How do I use this to list all key bindings which are Meta something:

You don't; Meta isn't a prefix.  Stick with `bindkey | fgrep \"\\M` ...

}   bindkey -p \\M
} doesn't work.

The -p option is using getkeystring(), which returns an empty string when
parsing a \M by itself.  It might be possible to special-case it, but \M
is not a real character any more than \C is, and the current implemention
needs at least one character of prefix to compare with.  (Do you expect to
be able to list all control-character bindings with `bindkey -p ^' ?

} Also, I've just noticed that the output of bindkey includes these:
} 
} "^\^" up-case-word
} "^\^[OA" up-history
} "^\^[OB" down-history
} "^\^[OC" forward-char
} "^\^[OD" backward-char
} "^\^[[A" up-history
} "^\^[[B" down-history
} "^\^[[C" forward-char
} "^\^[[D" backward-char
} 
} The first one is set from this command in my .zshrc:
}     bindkey '^^' up-case-word
} but I don't see where the back-slash came from.

In double quotes, a backslash quotes the following character and then is
removed, so "^\^" is the same as "^^", and not the same as "^\\" (which
to bindkey is control-backslash).  I don't know why bindkey decided it
needs to backslash the second carat.

} I also don't see why the others should start with ^\. I don't know where
} they come from - after zsh -f followed by . ./.zshrc, they aren't there

That part has me stumped.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



Messages sorted by: Reverse Date, Date, Thread, Author