Not sure if this is a zsh issue or a oh-my-zsh customisation.
I had omz and with ctrl+r I could search in history. I've just tried to do that with Prezto and it didn't work.
FWIW this has always worked for me with Prezto.
ctrl + r works for me with prezto
On Apr 26, 2014 9:58 AM, "Brad Feehan" [email protected] wrote:
FWIW this has always worked for me with Prezto.
—
Reply to this email directly or view it on GitHubhttps://github.com/sorin-ionescu/prezto/issues/596#issuecomment-41462767
.
Still can't get it to work. Used to work just fine with oh-my-zsh, can't get a peep out of it with Prezto.
It may be your terminal. Check key bindings.
Enable history-substring-search and use up/down arrow or ^P/^N instead.
I’m sorry but none of these things seem to work.
I’ve enabled history-substring-search and restarted Terminal. Ctrl + r doesn’t work and not sure how to use ^P/^N.
I’m using the latest OSX with the Terminal that ships with it.
On 26 Apr 2014, at 17:16, Sorin Ionescu [email protected] wrote:
It may be your terminal. Check key bindings.
Enable history-substring-search and use up/down arrow or ^P/^N instead.
—
Reply to this email directly or view it on GitHub.
Rui Pacheco
^ means Control; so, Control + P/N. You can also use the arrow keys. Type something first then hit CTRL + P.
Can you try check an alternative terminal to see if you have the same issue?
For example try iTerm 2
That's my default termninal app.
Hope this helps,
Stefano
Just downloaded iTerm2. No Ctrl + r either.
… and suddenly I remembered why I gave up on it years ago - that font :|
On 28 Apr 2014, at 21:21, Stefano Schiavi [email protected] wrote:
Can you try check an alternative terminal to see if you have the same issue?
For example try iTerm 2That's my default termninal app.
Hope this helps,
Stefano
—
Reply to this email directly or view it on GitHub.
Rui Pacheco
Ok try this then :
Goto your HomeFolder -> Library -> Preferences and delete the file :
com.apple.terminal.plist
This will reset your terminal app. This way we can determine if it is a
terminal configuration issue or something else.
Before you delete you may want to make a backup copy.
Hope this helps.
Stefano
Quit terminal, deleted the file, restarted terminal, tried to do Ctrl + r again, didn’t work.
On 29 Apr 2014, at 14:55, Stefano Schiavi [email protected] wrote:
Ok try this then :
Goto your HomeFolder -> Library -> Preferences and delete the file :
com.apple.terminal.plistThis will reset your terminal app. This way we can determine if it is a
terminal configuration issue or something else.Before you delete you may want to make a backup copy.
Hope this helps.
Stefano
—
Reply to this email directly or view it on GitHub.
Rui Pacheco
I see, I am sorry but at the moment I don't have any additional ideas.
Perhaps someone else can help?
S’ok, I’ll do some more research by myself tomorrow and try to come up with something. Don’t close the case and many thanks for the help!
On 29 Apr 2014, at 15:14, Stefano Schiavi [email protected] wrote:
I see, I am sorry but at the moment I don't have any additional ideas.
Perhaps someone else can help?
—
Reply to this email directly or view it on GitHub.
Rui Pacheco
Btw, I recently started using prezto on ubuntu with terminator + tmux and ^R nor ^P/^N will work.
I don't remember if i worked on the mac and I don't have i right now to test it.
You can type bindkey -L to list key bindings. It's possible that the terminal emulator or terminal multiplexer is capturing those keys and not sending them to Zsh.
Output for the aforementioned setup (^R seems to be bound to redisplay):
bindkey -R "^A"-"^C" self-insert
bindkey "^D" list-choices
bindkey -R "^E"-"^F" self-insert
bindkey "^G" list-expand
bindkey "^H" vi-backward-delete-char
bindkey "^I" expand-or-complete-with-indicator
bindkey "^J" accept-line
bindkey "^K" self-insert
bindkey "^L" clear-screen
bindkey "^M" accept-line
bindkey -R "^N"-"^P" self-insert
bindkey "^Q" push-line-or-edit
bindkey "^R" redisplay
bindkey -R "^S"-"^T" self-insert
bindkey "^U" vi-kill-line
bindkey "^V" vi-quoted-insert
bindkey "^W" vi-backward-kill-word
bindkey "^X" self-insert
bindkey "^X^R" _read_comp
bindkey "^X^S" prepend-sudo
bindkey "^X?" _complete_debug
bindkey "^XC" _correct_filename
bindkey "^Xa" _expand_alias
bindkey "^Xc" _correct_word
bindkey "^Xd" _list_expansions
bindkey "^Xe" _expand_word
bindkey "^Xh" _complete_help
bindkey "^Xm" _most_recent_file
bindkey "^Xn" _next_tags
bindkey "^Xt" _complete_tag
bindkey "^X~" _bash_list-choices
bindkey -R "^Y"-"^Z" self-insert
bindkey "^[" vi-cmd-mode
bindkey "^[," _history-complete-newer
bindkey "^[/" _history-complete-older
bindkey "^[E" expand-cmd-path
bindkey "^[M" copy-prev-shell-word
bindkey "^[OA" history-substring-search-up
bindkey "^[OB" history-substring-search-down
bindkey "^[OC" forward-char
bindkey "^[OD" backward-char
bindkey "^[Q" push-line-or-edit
bindkey "^[[1~" beginning-of-line
bindkey "^[[2~" overwrite-mode
bindkey "^[[3~" delete-char
bindkey "^[[4~" end-of-line
bindkey "^[[A" up-line-or-history
bindkey "^[[B" down-line-or-history
bindkey "^[[C" vi-forward-char
bindkey "^[[D" vi-backward-char
bindkey "^[[Z" reverse-menu-complete
bindkey "^[e" expand-cmd-path
bindkey "^[m" copy-prev-shell-word
bindkey "^[q" push-line-or-edit
bindkey "^[~" _bash_complete-word
bindkey -R "^\\\\"-"^_" self-insert
bindkey " " magic-space
bindkey -R "!"-"~" self-insert
bindkey "^?" backward-delete-char
bindkey -R "\M-^@"-"\M-^?" self-insert
btw, this list is awesome. I wasn't aware of many of these bindings :O
But why would this work with oh-my-zsh and not Prezto?
On 29 Apr 2014, at 16:11, Sorin Ionescu [email protected] wrote:
You can type bindkey -L to list key bindings. It's possible that the terminal emulator or terminal multiplexer is capturing those keys and not sending them to Zsh.
—
Reply to this email directly or view it on GitHub.
Rui Pacheco
Look at the list, what does it say for ^R?
# .zpreztorrc file
# Set the Prezto modules to load (browse modules).
# The order matters.
zstyle ':prezto:load' pmodule \
'environment' \
'terminal' \
'editor' \
'history' \
'directory' \
'spectrum' \
'utility' \
'completion' \
'archive' \
'syntax-highlighting' \
'prompt' \
'git' \
'helper' \
'history-substring-search' \
'fasd' \
'ruby'
$ bindkey -L
...removing output...
bindkey "^R" history-incremental-search-backward
Are you sure you are using the correct modules and in the correct order?
Another thing, when I come into this kind of issues, I do some really dumb "logging", for example, before loading prezto I write something like:
### .zshrc
echo 'before load prezto: ' > $HOME/log.before
bindkey -L >> $HOME/log.before
# Source Prezto.
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
fi
echo 'after load prezto: ' > $HOME/log.after
bindkey -L >> $HOME/log.after
That way by trial and error I can found if something was changed before/after prezto, and then you can do the same with the modules.
Another alternative is doing something like:
set -x
exec 2>$HOME/log
(I'm doing that from memory, but that's the idea, you basically output everything to a log file, and you can get the pretty "debug" zsh has).
I've installed Prezto on a laptop that never had oh-my-zsh before and ctrl
On 3 May 2014 18:19, Pablo Olmos de Aguilera Corradini <
[email protected]> wrote:
Another thing, when I came into this kind of issues, I do some really dumb
"logging", for example, before loading prezto I write something like:.zshrc
echo 'before load prezto: ' > $HOME/log.before
bindkey -L >> $HOME/log.beforeSource Prezto.
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
fi
echo 'after load prezto: ' > $HOME/log.after
bindkey -L >> $HOME/log.afterThat way by trial and error I can found if something was changed
before/after prezto, and then you can do the same with the modules.Another alternative is doing something like:
exec > logfile.log
set -x(I'm doing that from memory, but that's the idea, you basically output
everything to a log file, and you can get the pretty "debug" zsh has).—
Reply to this email directly or view it on GitHubhttps://github.com/sorin-ionescu/prezto/issues/596#issuecomment-42109106
.
Rui Pacheco
Delete your terminal preferences to have them recreated, or transfer terminal preferences from the new machine to the old machine.
Hello,
I also have the problem as soon as I use the _vi_ key mapping style (zstyle ':prezto:module:editor' key-bindings 'vi)'
Which is expected because backward search is mapped to _?_ key in normal mode.
But in _vi_ key mapping style, after entering normal mode with _echap_ key and after starting backing search with _?_ key, I don't find a way to navigate to older commands with given search pattern (hitting Ctrl-R several time in emacs mode allow you to select oldest command).
Bertrand
I had this same issue and thanks to @bcachet comment I found this:
http://zshwiki.org/home/zle/bindkeys#why_isn_t_control-r_working_anymore
I added those two lines to my zsh config and now everything seems to be working.
Thanks @bcachet I was having the same issues as @ruipacheco and turns out it was because I had set my bindings to vi rather than emacs. :smile:
As stated above, if hitting ^R doesn't do anything (OS X) and hitting ^A or ^E display the literal characters instead of jumping to the beginning and end of the current cmd you're typing, respectively, you probably have zstyle ':prezto:module:editor' key-bindings set to vi instead of emacs.
In ~/.zprezto/runcoms/zpreztorc, set:
zstyle ':prezto:module:editor' key-bindings 'emacs'
This article has workarounds for the keybindings in case you want to continue using the vi bindings.
I fix with this key bindings in .zshrc
bindkey -M viins '^r' history-incremental-search-backward
bindkey -M vicmd '^r' history-incremental-search-backward
thanks @gabamnml !! you saved my life!
I'm working on iterm2 with oh-my-zsh and I enabled set -o vi, your solution works for me.
btw, I'm not using presto, so I think it's not a presto issue.
@soooooot mmm.. freak, because to my left me to work when installed Prezto because before with Oh My Zsh works. I'm glad you now work. I went also to be happy after doing this.
I solve the problem by deleting vi-mode in my .zshrc, with these codes, ctrl + r not work:
plugins=(git autojump tmux vi-mode)
For anyone wondering how to make Ctrl-N and Ctrl-P work again also in vi mode:
bindkey '^N' down-line-or-history
bindkey '^P' up-line-or-history
Add 'bindkey -e' to .zshrc file to solve ctrl + a command does not work issue.
Most helpful comment
I fix with this key bindings in
.zshrc