2

I tried

(eval-after-load 'cider
  '(progn
     (define-key cider-mode-map (kbd "<C-tab>") 'cider-switch-to-repl-buffer)
     (define-key cider-repl-mode-map (kbd "<C-tab>") 'cider-switch-to-repl-buffer)))

But it only works in the buffer, i.e. I can switch from the buffer to the repl, but not the other way around. What I'm trying to achieve is to use C-tab to switch back and forth between the buffer and the repl.

Thanks!

damonh
  • 515
  • 2
  • 10

1 Answers1

1

I think the function you want to bind in the repl is cider-switch-to-last-clojure-buffer, eg

(with-eval-after-load "cider-mode"
  (define-key cider-repl-mode-map (kbd "<C-tab>")
    'cider-switch-to-last-clojure-buffer))
Rorschach
  • 31,301
  • 5
  • 78
  • 129
  • 1
    @damonh if you know its normal keybinding, it's even easier from the repl to just do `C-h k` `C-c C-z` – Rorschach May 11 '17 at 13:02
  • 1
    It's usually better to put the `define-key` on a mode hook (e.g. `cider-repl-mode-hook`, presumably) than to use `with-eval-after-load` to define the key. Is there some reason that that won't work here? – Drew May 11 '17 at 16:04
  • @Drew personally I have all my mode configs in separate files that with autoload hooks, so I imagine everyone does it differently. – Rorschach May 11 '17 at 16:06