Fork me on GitHub
#emacs
<
2021-05-09
>
André Peric Tavares20:05:53

Hi folks. I’ve been working on vilpy [1], a fork of lispy [2], a vi-like paredit. In regards to Clojure, these are the main differences compared to the original lispy: - Do not inject Clojure code to cider. lispy does that for adding some niceties but it gets in the way depending on the project setup. - Do not rely on internal details from cider. For evaluation, just use cider-eval* functions. - Do not assume that cider is used at all. Supports inf-clojure. Furthermore, In general, vilpy is less featureful by design. I removed tons of obscure commands and language-specific functions. For more difference, please consult [3]. Feedback is welcome. [1]: https://github.com/Andre0991/vilpy [2]: https://github.com/abo-abo/lispy [3]: https://github.com/Andre0991/vilpy#lispy

grazfather20:05:25

Why are you writing a fork? just curious what part of lispy bothered you enough to write your own

grazfather20:05:57

(I see the section now)

grazfather20:05:12

Have you seen lispyville?

André Peric Tavares20:05:44

I confess I didn’t understand lispyvilles README when I read it for the first time. It seemed pretty complicated. After working with vilpy, I think I would grok it today, but I was always fine using lispy commands in insert mode and vim commands in normal mode. (ironically, I’m experimenting with Emacs bindings today anyway.) But thanks for reminding me, I’ll add a section about lispyville in the README.

grazfather20:05:42

for sure! I happen to hate the lispy minor mode, it’s madness. I use lispyville to basically bind some lispy functions when I am in evil-normal mode. I would be interested to trying yours out. To me navigating sexps, moving them, and slurp/barf are the most important

grazfather20:05:55

fwiw:

; Lispyville needs Lispy, but I don't want to ever use the insane lispy-mode
; bindings.
(use-package! lispy)
(use-package! lispyville
  :hook ((lisp-mode . lispyville-mode)
         (emacs-lisp-mode . lispyville-mode)
         (ielm-mode . lispyville-mode)
         (scheme-mode . lispyville-mode)
         (racket-mode . lispyville-mode)
         (hy-mode . lispyville-mode)
         (lfe-mode . lispyville-mode)
         (dune-mode . lispyville-mode)
         (clojure-mode . lispyville-mode)
         (fennel-mode . lispyville-mode))
  :init
  (setq lispyville-key-theme
        '((operators normal)
          c-w c-u                       ; Ctrl-w and Ctrl-u are sexp aware
          (atom-movement t)
          slurp/barf-lispy              ; >/< to 'grow' and 'shrink' sexps
          additional                    ; M-j/k to swap atoms forward/back
          additional-insert))           ; M-{i,a,o,O} for sexp-aware enter insert
  :config (lispyville-set-key-theme))

André Peric Tavares20:05:26

Got it. In this case, I guess vilpy won’t help you much: its minor mode is identical to lispys. It’s just ‘vimmier’ in the sense that its keybindings are more vim-like. In my case, when using evil, I just got used to staying in insert mode for editing lisps. I tried to avoid normal mode as much as possible since lispy is generally enough (albeit not familiar or comfortable for one that expects vim). However, I’ll add in the README one could replicate lispyville with vilpy. That would require another package (say a vilpyville), but creating such package shouldn’t be too difficult: I guess it’s mostly a matter of replacing lispy with vilpy and possibly fixing some renamed functions. I don’t have the motivation for doing this right now, but I might try it someday.

André Peric Tavares20:05:29

Or, better yet, maybe simply aliasing vilpy functions to the lispy equivalents would make lispyville work already.

grazfather21:05:44

Cool. Thank you for the explanation. We have a different philosophy here :)

👍 3
André Peric Tavares02:05:22

Just to further clarify this issue (for people that are not aware of all those packages): both lispy and vilpy are not aware of evil. This is by design. Using their minor modes while in insert mode and evil’s commands in normal mode is possible and works for some people. However, for a real integration with evil, a package on top of lispy is required, and that’s usually lispyville.