Note that there are some explanatory texts on larger screens.

plurals
  1. POEmacs Prelude, Smartparens, and OsX
    primarykey
    data
    text
    <p>I'm using OSX 10.9, iTerm2, Emacs Prelude, and Clojure with all the modes that entails most relevantly, <code>smartparens</code>. Good so far. </p> <p>The short version is: has anybody out there found a harmonious way to use all of this together with OSX Mission Control? </p> <p>The longer version goes: I want to be able to use commands like <code>sp-forward-slurp-sexp</code>, which has a default keybinding of <code>C-&lt;right&gt;</code>, better known as the default OS-level shortcut for "switch Spaces right via Mission Control." I can re-map that fairly easily (say, to <code>C-Shift-&lt;right&gt;</code>) -- but now, I discover that <code>C-&lt;right&gt;</code> actually seems to be sending something like <code>M-[1;4A</code>. Instead of triggering <code>sp-forward-slurp-sexp</code>, you get <code>sp-wrap-with-pair "["</code>. Uhm.</p> <p>I dug up this <a href="http://offbytwo.com/2012/01/15/emacs-plus-paredit-under-terminal.html" rel="nofollow noreferrer">dissertation on re-mapping keys</a>, which is very thorough, but also involves re-mapping rather a deal of stuff, then disabling the parts of <code>paredit</code> that are listening for the <code>M-[</code> command. While this technically seems to work, I actually rather like having <code>sp-wrap-with-pair</code> enabled. Perhaps a better option would be to embrace the theoretically equivalent <code>C-(</code> -- except iTerm2 only interprets that as a literal 9, and <code>C-)</code> as 0. <a href="https://stackoverflow.com/questions/6260754/just-getting-used-to-paredit-in-emacs-on-os-x-how-come-c-doesnt-work">This SO post</a> chews on this problem, and gets as far as a tantalizing comment suggesting that <code>C-(</code> and <code>C-)</code> simply be re-mapped to escape sequences that emacs can map <em>back</em> to <code>C-(</code> and <code>C-)</code> -- but frankly, I haven't a clue how to figure out what escape sequences those should be. </p> <p>Bringing it all home: has anybody found a way to use all of these tools (Mission Control, iTerm2, Emacs Prelude, smartparens) together without having to re-wire or disable parts of some or most of them? Or: who has the most elegant re-wiring? Anybody figured out the <code>C-)</code>-to-escape-sequence-back-to-<code>C-)</code> trick yet?</p> <p><strong>Edit</strong></p> <p>Stabbing in the dark, I've done the following: 1. Set iTerm to send an escape sequence for the keyboard shortcut Ctrl-Shift-0 (<code>C-S-)</code>) of <code>SPRTPRN</code>. 2. Put this in my emacs config:</p> <pre class="lang-lisp prettyprint-override"><code>(define-key input-decode-map "\eSPRTPRN" [C-right-paren]) (global-set-key [C-right-paren] (kbd "C-)")) </code></pre> <p>...it does not work, but I've a hunch I'm getting closer. I think.</p> <p><strong>Edit, Again</strong></p> <p>I realized something: the notion that Shift doesn't work here doesn't make sense to me. At least on my emacs install, M-&lt; and M-> jump to the beginning and end of a buffer, respectively -- and to use those commands, I have to actually <em>press</em> Meta-Shift-&lt;. Huh.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload