Skip to content

Instantly share code, notes, and snippets.

@terjesb
Created December 11, 2012 10:38

Revisions

  1. terjesb revised this gist Dec 11, 2012. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -6,15 +6,15 @@ Caps Lock is mapped to Control.

     > System Preferences > Keyboard > Keyboard > Special: Caps Lock: ^ Control
    iTerm > Preferences > Keys: Left Command key mapped to Right Option
    iTerm > Preferecnes > Profiles > Keys: Right option acts as: +Esc
    iTerm > Preferences > Profiles > Keys: Right option acts as: +Esc

    http://offbytwo.com/2012/01/15/emacs-plus-paredit-under-terminal.html
    Loaded xterm Defaults.
    Verified/added escapes for:
    ^⇧↑ Send ^[ [1;6A
    ^⇧↓ Send ^[ [1;6A
    ^⇧→ Send ^[ [1;6A
    ^⇧← Send ^[ [1;6A
    ^⇧↓ Send ^[ [1;6B
    ^⇧→ Send ^[ [1;6C
    ^⇧← Send ^[ [1;6D
    ^⌥↑ Send ^[ [1;8A
    ^⌥↓ Send ^[ [1;8B
    ^⌥→ Send ^[ [1;8C
  2. terjesb created this gist Dec 11, 2012.
    46 changes: 46 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,46 @@
    iTerm2 emacs 24.2.1 -nw with paredit on OS X 10.8 Norwegian layout

    Left Command is my Meta.
    Left Alt used for inputting special characters.
    Caps Lock is mapped to Control.

     > System Preferences > Keyboard > Keyboard > Special: Caps Lock: ^ Control
    iTerm > Preferences > Keys: Left Command key mapped to Right Option
    iTerm > Preferecnes > Profiles > Keys: Right option acts as: +Esc

    http://offbytwo.com/2012/01/15/emacs-plus-paredit-under-terminal.html
    Loaded xterm Defaults.
    Verified/added escapes for:
    ^⇧↑ Send ^[ [1;6A
    ^⇧↓ Send ^[ [1;6A
    ^⇧→ Send ^[ [1;6A
    ^⇧← Send ^[ [1;6A
    ^⌥↑ Send ^[ [1;8A
    ^⌥↓ Send ^[ [1;8B
    ^⌥→ Send ^[ [1;8C
    ^⌥← Send ^[ [1;8D

    ;; added mappings to .emacs
    (define-key input-decode-map "\e[1;5A" [C-up])
    (define-key input-decode-map "\e[1;5B" [C-down])
    (define-key input-decode-map "\e[1;5C" [C-right])
    (define-key input-decode-map "\e[1;5D" [C-left])
    (define-key input-decode-map "\e[1;6A" [C-S-up])
    (define-key input-decode-map "\e[1;6B" [C-S-down])
    (define-key input-decode-map "\e[1;6C" [C-S-right])
    (define-key input-decode-map "\e[1;6D" [C-S-left])
    (define-key input-decode-map "\e[1;8A" [C-M-up])
    (define-key input-decode-map "\e[1;8B" [C-M-down])
    (define-key input-decode-map "\e[1;8C" [C-M-right])
    (define-key input-decode-map "\e[1;8D" [C-M-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])
    (define-key input-decode-map "\e[1;10A" [S-M-up])
    (define-key input-decode-map "\e[1;10B" [S-M-down])
    (define-key input-decode-map "\e[1;10C" [S-M-right])
    (define-key input-decode-map "\e[1;10D" [S-M-left])
    (define-key paredit-mode-map (kbd "M-(") 'paredit-wrap-round)
    (define-key paredit-mode-map (kbd "C-S-<left>") 'paredit-backward-slurp-sexp)
    (define-key paredit-mode-map (kbd "C-S-<right>") 'paredit-backward-barf-sexp)