Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: vi mode and history-search key binding
- X-seq: zsh-users 10323
- From: William Scott <wgscott@xxxxxxxxxxxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: vi mode and history-search key binding
- Date: Sat, 27 May 2006 23:47:35 -0700 (PDT)
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <060527221713.ZM25658@xxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <0CDE54A6-04FA-4821-A51D-26552316040A@xxxxxxxxxxxxxxxxxx> <060527221713.ZM25658@xxxxxxxxxxxxxxxxxxxxxx>
B
On Sat, 27 May 2006, Bart Schaefer wrote:
On May 27, 8:39pm, William Scott wrote:
}
} bindkey '\e[A' vi-history-search-backward
} bindkey '\e[B' vi-history-search-forward
This binds those keys in the main keymap, which by default is the emacs
keymap. Have you somewhere earlier in your startup files executed a
"bindkey -v" command? If you did, then those bind keys in the viins
keymap (insert mode), not the vicmd keymap (command mode). In which
mode are you attempting to invoke the search?
} It appears to have no effect. Is this intended?
The effect you should see is that a quetion-mark (for backward) or slash
(for forward) prompt appears below the PS1 prompt; you then enter the
string to search for. If that doesn't happen, you've probably bound
the keys in the wrong keymap.
Sorry, I misunderstood what vi-history-search-forward, etc, does.
bindkey -v
bindkey '\e[A' history-search-backward
bindkey '\e[B' history-search-forward
gives me the desired behavior.
Thanks for pointing out what should have been obvious. (I just issued
bindkey -v on the command line to experiment. I'm not sure what it says
about the ossified state of my brain, but even as a vi(m) user, I can't
seem to break the emacs keybinding habbits in the shell. It was far easier
to switch from tcsh to zsh. I'll give it the weekend.)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author