Hi, I wanted to test lispy to see if it suits me better than paredit (I have an issue with packages that hijack default editor keybindings). However, I found a https://old.reddit.com/r/emacs/comments/1fn0dq9/starting_a_temporary_fork_of_lispy_until_aboabo/ that mentions lispy doesn't work well with recent versions of cider. Any users of lispy + cider here that want to share what they currently do about this? Anyone using the fork?
For those using lispy that like the 'special' keybindings but would like to use the (more reliable) equivalent cider commands directly when in clojure-mode, this is what I ended up with while learning lispy:
(defun switch-cider-lispy (cider-fn lispy-fn)
(interactive)
(if (eq major-mode 'clojure-mode)
(call-interactively cider-fn)
(call-interactively lispy-fn)))
(defun gk-cond-lispy-eval () (interactive)
(switch-cider-lispy 'cider-eval-sexp-at-point 'lispy-eval))
(defun gk-cond-lispy-eval-and-insert () (interactive)
(switch-cider-lispy 'cider-eval-defun-at-point 'special-lispy-eval-and-insert))
(defun gk-cond-lispy-describe-inline () (interactive)
(switch-cider-lispy 'cider-clojuredocs 'lispy-describe-inline))
(defun gk-cond-lispy-follow () (interactive)
(switch-cider-lispy 'ignore 'lispy-follow)) ; no-op in clojure-mode, use cider
(defun gk-cond-lispy-eval-other-window () (interactive)
(switch-cider-lispy 'ignore 'lispy-eval-other-window)) ; no-op in clojure-mode
;; disable the "smart" functions, use clojure-mode/cider/clj-refactor equivalents (if at all)
(defun gk-cond-lispy-x () (interactive)
(switch-cider-lispy 'ignore 'lispy-x))
;; local bindings
(lispy-define-key lispy-mode-map "e" 'gk-cond-lispy-eval) ; current sexp
(lispy-define-key lispy-mode-map "E" 'gk-cond-lispy-eval-and-insert) ; top-level sexp
(lispy-define-key lispy-mode-map "p" 'gk-cond-lispy-eval-other-window)
(lispy-define-key lispy-mode-map "F" 'gk-cond-lispy-follow)
(lispy-define-key lispy-mode-map "x" 'gk-cond-lispy-x)
;; global bindings
(define-key lispy-mode-map (kbd "C-1") 'gk-cond-lispy-describe-inline)
(define-key lispy-mode-map (kbd "C-2") nil) ; signature shown in minibuffer already
(define-key lispy-mode-map (kbd "C-4") 'gk-cond-lispy-x)CIDER and clojure-mode know nothing about paredit or lispy, that's all I can say
FWIW, I use regular lispy with latest cider. Whatever is broken doesn't seem to affect me 🤷♀️
I checked the fork and apparently only lispy-eval was fixed to handle some changed behavior of cider--display-interactive-eval-result. I guess if you use cider commands directly for that, that's not a big deal.
Alright not ideal that the original project seems to be unmaintained, but I'm going to give it a try.
Did I imagine that one could in the past change the cider overlay result size? I want to heavily truncate this, for performance reasons. Does someone know the variable name and or way to do this?
Thanks for that and for your work in general! It wasn't that, but that gives me enough to hack around it without the maintenance burden for the project.
Glad to help!
It may be that this draft PR offered a possible fix https://github.com/clojure-emacs/cider/pull/3635/files (last comment in the thread says why it's closed)