Fork me on GitHub
#emacs
<
2022-03-20
>
jmckitrick02:03:53

After switching to vertico/orderless/consult/corfu has anyone had issues with completion on namespaced symbols or symbols with an alias?

jmckitrick03:03:13

@mpenet I’m using your emacs config for inspiration, but I’m not sure I’m ready to run cider and lsp side-by-side so I’m skipping that for now

AC04:03:25

there are a few github issues about this (spread across cider, corfu, orderless repos). here’s one — https://github.com/clojure-emacs/cider/issues/3019 I currently work around this by using the basic completion-style for cider buffers.

(use-package cider
  ...
  :hook
  (cider-mode . (lambda () (setq-local completion-styles '(basic)))))
(there are probably better ways to set it, but I’m hoping it’s temporary)

jmckitrick13:03:11

That did the trick! Thank you @U0124C56J5R

apt14:03:53

> After switching to vertico/orderless/consult/corfu has anyone had issues with completion on namespaced symbols or symbols with an alias? I don’t remember having that kind of issues. However, I think I’m relying solely on lsp for completions (I’m using eglot + inf-clojure , not cider, if that’s relevant)

Akiz15:03:56

Why eglot instead of lsp-server?

apt20:03:29

It felt more emacsy than lsp-mode. Maybe that’s because I had lsp-ui or something, though, and it’s unrelated to lsp-mode itself. In any case, I like eglot ’s defaults and I enjoy it being so minimal and unobtrusive. But both are great. Note that jumping to definition does not work for external dependencies in eglot yet.

apt20:03:29

Additionally, using eglot was part of an experiment of creating my own config and using small packages. I stopped using doom-emacs (which is great, btw) and started my own config, used vertico, corfu with no automatic completion instead of company, eglot, inf-clojure instead of cider etc. I enjoyed the result.

Akiz09:03:29

Interesting I would love to see a demo of this. Did you do it because you want a cleaner and more minimalistic setup that just works? Or did you get some extra functionality also?

apt17:03:46

> Did you do it because you want a cleaner and more minimalistic setup that just works? Yeap, that sums it up well. Fewer moving parts. Simpler and intentionally dumber. By far, the biggest difference is using inf-clojure (socket repl) instead of cider(nrepl). I think my workflow doesn’t have anything exceptional, it’s just using a repl. Sean Corfield has a few good videos. He’s not using Emacs but he uses a socket repl as well. Here’s my current config: https://github.com/Andre0991/dotfiles/blob/master/emacs.el

🧑‍🎓 1
Akiz16:03:24

@U976F1AR2 Just a question -Why do you use Corfu if you dont have an automatic completion for Clojure? Just because of elisp?

apt16:03:37

Feel free to ask. corfu gets Clojure completions with LSP

Akiz16:03:56

Hmph, I am trying eglot right now - that works. Corfu works for me in elisp buffer (or eshell). But i dont get any completion with eglot + corfu in clj buffer. This is my config.

(use-package eglot
      :ensure t)

(add-hook 'clojure-mode-hook 'eglot-ensure)

(use-package corfu
         :config 
         (add-hook 'prog-mode-hook 'corfu-mode)
         (add-hook 'shell-mode-hook 'corfu-mode)
          (with-eval-after-load 'corfu
              (setq corfu-auto nil)
              (define-key corfu-map (kbd "SPC") #'corfu-insert-separator)))

apt16:03:14

Oh, sorry for the confusion. I meant ‘no automatic completion’ in the sense that the completions list does not show up automatically. I have to press tab in order to show them. This is corfu’s default behaviour, by the way. It’s customizable.

👍 1
Akiz16:03:31

Ah, tab doesnt work for me in clojure buffer (no cider or infer installed yet). Both processes are running. Strange. Otherwise - this minimalistic setup seems great for my 2019 i3 macbook

apt16:03:07

Nice, good to hear that. On having tab to get completions in Clojure, I think having eglot connected to the clojure-lsp server should be enough. As the config has

(add-hook 'clojure-mode-hook 'eglot-ensure)
it should connect to LSP just after visiting a Clojure buffer (assuming clojure-lsp is on PATH)

Akiz17:03:47

It does, lsp works great. I just dont see any corfu integration. It will be some silly mistake probably on my side. Thanks

👍 1
Akiz08:03:55

Ive got it… It is mapped to meta+tab in clojure. Btw. i am looking at your vilpy package - would you use it with evil?

apt20:03:27

It can be used with evil. The README has some elisp for preventing some bindings shadowing. I don’t use evil nowadays, though. When I used lispy/`vilpy` with evil, I mostly stayed in insert mode when editing lisps.

👍 1