Posts
-
which-key is Now Built-in
which-keyis one of those packages I recommend to pretty much everyone - newcomers and grizzled Emacs veterans alike. You start a key sequence likeC-x, pause for a moment, and it pops up a handy cheat sheet of every key that can follow. I’ve had it in my config for ages, and I suspect a lot of you have as well.Here’s the good news - as of Emacs 30 you don’t need to install it anymore.
Read Morewhich-keyis now a built-in package, so there’s one less thing to fetch from MELPA when you set up Emacs on a fresh machine. -
Tree-sitter Modes Still Need a Syntax Table
When you write a tree-sitter major mode, it’s tempting to think the parser handles everything. It doesn’t. Tree-sitter drives font-lock, indentation, and structural navigation, but a whole layer of everyday Emacs behavior still runs on the humble syntax table:
forward-sexpand friends,electric-pair-mode,delete-pair,forward-word, and anything built onsyntax-ppss. (I wrote about that structural layer in Essential Structured Navigation and Editing Commands.)I got a sharp reminder of this while building neocaml, my tree-sitter mode for OCaml. The grammar parsed everything beautifully, yet
Read Moredelete-pairand sexp motion kept misbehaving around a couple of OCaml constructs. The fix turned out to be a classic tool that long predates tree-sitter:syntax-propertize-function. Here’s the story - it tripped me up for a good while, so maybe it’ll spare you some head-scratching. -
Inline Completion with completion-preview-mode
As part of the ongoing overhaul of my Emacs setup I’ve been trying to make the most of the built-in functionality that recent Emacs releases keep quietly shipping. My in-buffer completion setup is based on
corfuandcapethese days, but it turns out I had overlooked a nice Emacs 30 addition in the same area -completion-preview-mode. It gives you inline completion suggestions - the “ghost text” UI that GitHub Copilot and friends made famous1 - except here it’s powered by plain old Emacs completions.Read More-
Unlike the AI assistants, the suggestions here come straight from your ↩
-
-
All Aboard Embark!
Yesterday I published a post about Jinx, where I mentioned in passing that dropping Flyspell freed up
C-.andC-;for embark, and that this would be a topic for another article. Well, here it is!Embark has been around for quite a few years, and pretty much everyone in the
Read Morevertico/consultcrowd swears by it. Somehow I never got around to adopting it until my recent config overhaul, and now I keep asking myself why I waited so long. -
Cape: Corfu's Best Friend
I’ve been using corfu for in-buffer completion for a while now and I’m quite happy with it. There was one thing that kept bugging me, though - the completion popup would only ever show whatever the current major mode’s completion function had to offer. No plain word completion, no file name completion - if the major mode (or your LSP server) didn’t know about something, neither did the popup.
Turns out I was simply missing one piece of the puzzle, namely cape.
Read More
Subscribe via RSS | View Older Posts