Search code examples
emacscider

How to properly bind cider-switch-to-repl-buffer to <C-tab>?


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!


Solution

  • 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))