18

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

1
  • backspace is ^H (ctrl-H) already. i'm afraid you can't combine it with another ctrl. Commented Dec 14, 2009 at 20:59

1 Answer 1

41

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 ...

Sign up to request clarification or add additional context in comments.

2 Comments

YES!! Thank you. Is there a recommended place to put something like this so it loads every time, or should I just stuff it into my .zshrc?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.