Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Home and End keys not working on CentOS #3733

Closed
leoheck opened this issue Mar 29, 2015 · 3 comments · May be fixed by #5113
Closed

Home and End keys not working on CentOS #3733

leoheck opened this issue Mar 29, 2015 · 3 comments · May be fixed by #5113

Comments

@leoheck
Copy link

leoheck commented Mar 29, 2015

Avarus presented a solution that work great here

#Rebind HOME and END to do the decent thing:
bindkey '\e[1~' beginning-of-line
bindkey '\e[4~' end-of-line
case $TERM in (xterm*)
bindkey '\eOH' beginning-of-line
bindkey '\eOF' end-of-line
esac

#To discover what keycode is being sent, hit ^v
#and then the key you want to test.

#And DEL too, as well as PGDN and insert:
bindkey '\e[3~' delete-char
bindkey '\e[6~' end-of-history
bindkey '\e[2~' redisplay

#Now bind pgup to paste the last word of the last command,
bindkey '\e[5~' insert-last-word
@jgrar
Copy link
Contributor

jgrar commented Mar 30, 2015

I'm confused.

Isn't this completely zsh settings related? Or do these keys still not work after binding them and loading oh-my-zsh?

I don't believe I've ever had home/end keys behave like this with zsh out-of-the-box, it doesn't define them like this for a reason: some people don't have these keys and sometimes they aren't mapped properly to begin wtih.

I don't think this is oh-my-zsh or centOS related.

FYI: CTRL+a and CTRL+e are the default keybinds for beggining-of-line and end-of-line, respectively.

@leoheck
Copy link
Author

leoheck commented Mar 31, 2015

You are right, the zsh does not have the home/end keys by default.
Thanks for the Ctrl+a and Ctrl+e tip. It will be very usefull.

@jgrar
Copy link
Contributor

jgrar commented Apr 15, 2015

I was likely too hastey dismissing this as a non-issue. OMZ apparently does bind home/end keys for this exact behaviour: https://github.com/robbyrussell/oh-my-zsh/blob/master/lib/key-bindings.zsh#L37

Could you please join the discussion in #3061 it would be helpful to coordinate some information gathering in one location.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants