2

I currently am using emacs via iTerm2 on OS X.

My keyboard setup works for the most part, but there are a few things that bug me.

  1. I am using the default iTerm2 keybindings with minor exception. I hard entered into emacs the escape sequences to get alt + arrow keys working:

    ;; iTerm2 key configs (define-key input-decode-map "\e[1;10A" [M-S-up]) (define-key input-decode-map "\e[1;10B" [M-S-down]) (define-key input-decode-map "\e[1;10C" [M-S-right]) (define-key input-decode-map "\e[1;10D" [M-S-left]) (define-key input-decode-map "\e[1;9A" [M-up]) (define-key input-decode-map "\e[1;9B" [M-down]) (define-key input-decode-map "\e[1;9C" [M-right]) (define-key input-decode-map "\e[1;9D" [M-left])

However, alt + left/right outside of emacs--say in bash--only records the raw character sequence: 9D;9C etc.

Most people online seem to recommend fixing this by binding the key combinations to ^]b and ^]f but obviously this isn't ideal because it breaks certain things in emacs (e.g. in Org Mode when M-left and M-right don't mean forward/backward word).

  1. I work off a laptop that has a function key. The page up and page down keys are hit by holding function and then up or down arrow. When I try this in cat it produces no output, so I can't see the escape sequence + put it into emacs. I would like to bind these key sequences to replace C-v and M-v.

Any help would be appreciated.

(Mods, for some reason I can't seem to format the code above properly.)

4

0 に答える 0