This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-20
Channels
- # announcements (1)
- # asami (2)
- # babashka (9)
- # babashka-sci-dev (33)
- # beginners (6)
- # calva (5)
- # cider (1)
- # clj-kondo (2)
- # clojure (79)
- # clojure-dev (8)
- # clojure-europe (1)
- # clojurescript (56)
- # core-logic (1)
- # datalevin (1)
- # emacs (20)
- # funcool (3)
- # holy-lambda (3)
- # honeysql (28)
- # improve-getting-started (11)
- # introduce-yourself (4)
- # lsp (21)
- # off-topic (9)
- # other-languages (5)
- # polylith (3)
- # quil (3)
- # releases (1)
- # rewrite-clj (9)
- # sql (5)
- # tools-deps (29)
- # xtdb (9)
After switching to vertico/orderless/consult/corfu has anyone had issues with completion on namespaced symbols or symbols with an alias?
@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
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)That did the trick! Thank you @U0124C56J5R
> 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)
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.
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.
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?
> 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
@U976F1AR2 Just a question -Why do you use Corfu if you dont have an automatic completion for Clojure? Just because of elisp?
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)))
And i misunderstood your message https://clojurians.slack.com/archives/C099W16KZ/p1648065929668689?thread_ts=1647786473.842079&cid=C099W16KZ where you say “no automatic completion”
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.
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
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)It does, lsp works great. I just dont see any corfu integration. It will be some silly mistake probably on my side. Thanks