Reputation: 897
So i want to be able to cargo run
with Ctrl + o.
I figured out that in zsh
that is spelled something like this: bindkey -s '^o' 'cargo run ^M'
. I put this in my .zshrc
, but when i start a shell this command does not exist, so i have to source ~/.zshrc
from inside the open shell. Then it works.
Why not on start?
Upvotes: 1
Views: 2620
Reputation: 897
In my case the problem appears to have been that i've been putting my command definitions before the following:
export ZSH=~/.oh-my-zsh
source $ZSH/oh-my-zsh.sh
Put your code after.
Upvotes: 1
Reputation: 31
I have a similar problem. It is very likely that other plugin settings in your .zshrc override the new key binding. You can try to backup your .zshrc and only keep the key binding to see if it works. If it works, then gradually add other settings back to see which one causes the problem. In my case, it is the zsh-vi-mode.
Upvotes: 3