Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Home" and "End" in IntelliJ terminal on Mac with zsh

I would like to bind fn+ and fn+ to "End" and "Home" in the IntelliJ terminal on my Mac (this is the very same combination that iTerm uses).

If this is not possible, I could also live with + and +.

I know that ctrl+e and ctrl+a can be used for jumping to the start and end of a line but for convenience I'd like to use the same combinations as within iTerm.

Edit

Interestingly, my keymap shows and as keybord shortcut for Move Caret to Line End and Move Caret to Line Start - it works in the editor - but it does not work in the terminal:

enter image description here

Edit 2

I found out that the problem occurs only with zsh - when I use bash, fn+ and fn+ work as expected. Any ideas where IntelliJ and zsh might conflict here? It works with the very same zsh configuration in iTerm.

like image 846
Michael Lihs Avatar asked Sep 01 '25 03:09

Michael Lihs


2 Answers

After searching for a while, I stumbled over this post

https://youtrack.jetbrains.com/issue/IDEA-118848

that covers the issue, a fix was proposed here

https://github.com/robbyrussell/oh-my-zsh/issues/4784#issuecomment-180940049

Following this fix, I added

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

to my .zshrc and now everything works like a charm.

like image 175
Michael Lihs Avatar answered Sep 02 '25 20:09

Michael Lihs


Default OS X bindings have fn+→ and fn+← to "End" and "Home" respectively.

If that is not the case for you, please update from keymap in settings panel.

Titled arrow shown in keymap binding means fn+→ or fn+← (based on direction of the arrow).

enter image description here

like image 39
DeepakV Avatar answered Sep 02 '25 22:09

DeepakV