Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bindkey with zsh on Mac

I've been trying to bind keys in zzh on a Mac but am having some trouble. I know I should be Googling this but couldn't find what I need...

I've been trying to bind ctrl-backspace to be an equivalent of ctrl-w, ie delete one word. But I can't find the key code for it. Nothing shows up when I do it with 'read'. I can't find a chart online either.

Also, I couldn't bind home/end keys (ie fn-left, fn-right) somehow. It is not bound in Terminal's keyboard assignments or .zshrc but it's still doing weird stuff when I press it. Page up and down seem to behave less strangely. Any help?

Thanks

like image 718
xster Avatar asked Dec 14 '09 20:12

xster


1 Answers

Open a shell and try pressing Ctrl-v and then the key you want to bind (eg. Home) This is the key sequence you should use with bindkey.

My bindings for Home/End (start/end of line) on Snow Leopard:

bindkey '^[[H' beginning-of-line
bindkey '^[[F' end-of-line

Still trying to bind cmd-left though ...

like image 100
thenoseman Avatar answered Sep 18 '22 05:09

thenoseman