Vertico Module Tasklist

Design Decisions

  • Finalize embark-act keybindings

    They are currently set to C-; and <leader> a. The motivation for this is as follows:

    • C-;

      Least intrusive key-chord type binding I could find. Doesn’t interfere with other keybindings for the most part (unlike C-o which clashes for in minibuffer evil-want-minibuffer users and regular buffer evil users), with the exception of:

      • C-; is bound to flyspell-auto-correct-previous-word. via the built in flyspell map.
      • C-; is bound to +company/complete in the vanilla emacs bindings.

      We could also just bind it in the minibuffer if we do end up going with the leader key.

    • Alternative chord: C-,

      Still has some overlaps, but perhaps less important:

      • flyspell-goto-next-error
      • org-cycle-agenda-files has redundancy in C-' anyway.

      It is however less convenient than C-;

    • <leader> a

      Even though top level module dependant bindings are frowned upon, here is my case for why this should be an exception:

      • It provide a useful shortcut for a bunch of commands relevant to the symbol at point, and seems to be better at this than built in stuff, e.g. doing <leader> f D to delete a file in eshell doesn’t work, but embark recognises that it’s a file, so <leader> a d does.
      • other than helping with discoverability for stuff this also allows for commands for things that are too niche for top level bindings, such as actions on package! statements and recipes or urls.
      • vertico is slated to become the default completion module, which makes this less of an inconsistency, but I’m not sure about the performance slowdown in map! since that seems to be one of the main concerns.
      • embark like most packages in the vertico cinematic universe can be installed independently, so if you find it sufficiently useful you could also have a stripped down version of the config in doom core that is just used for on-buffer actions.
    • We also might want to add keybindings for embark-dwim

  • SPC s s and SPC s S :sw ?

    There isn’t really a vertico/consult analogue to swiper-isearch, consult-isearch does something else (give you previously used isearch search terms). Bound to consult-line for now.

  • C-c C-e

    On consult-line this opens a occur-edit buffer, which is a more natural fit but breaks slightly from the C-c C-e = wgrep convention.

  • Annotation Customization

    Do we want to have the annotations be more like ivy? e.g.

    • Have a project column in the buffer annotations and a relative path? This has some overlap with project narrowing SPC b B p SPC.
    • Mark the modified/remote status of the buffer with color, on top of the modification column?
    • Change colors in general?
  • Orderless

    • Style dispatchers

      Currently the ! style dispatcher is only as a prefix, due to the abundance of ! final macros. In my opinion this is useful enough to break consistency.

    • Completion Style on file paths

      Currently we have the following completion style override for files:

      (setq completion-category-overrides 
            '((file (styles . (orderless partial-completion)))))
      

      This means that parital-completion matches (basically completing word prefixes + globbing) only get considered if there are no orderless matches. I find this to be the useful order, since I only really want partial-completion for the globbing, but it does mean that you lose the ability to type the first few letters of a file and only get the files that start with that, since you get broader orderless matching. Ivy doesn’t have this distinction with prescient on, but does seem to only show hidden files only after there are no visible ones left, which we don’t have here.

      This also relates to the recommended settings in the vertico readme for remote hostname completion somewhat. It’s hard for me to figure out what’s best here because I don’t have any remotes to try this out on.

    • Initialisms by default

      Do we want to use orderless+initialism by default for some of the completion categories? see here.

  • Decide what Vertico extensions to use

    Currently we only use vertico-repeat. Do we want to use any other ones or leave that to users?

    vertico-mouse would probably be good to have on by default, but something in doom is making it slow.

  • Decide what to do with embark-package-map

  • Company completion style

    Currently we advise company-capf--candidates to try the default emacs completion styles before orderless, since trying orderless first leads to a bunch of junk candidates. We could let the company completion style here be a variable for mildly easy customization, and we could also use orderless but use a custom sorting function like vertico-sort-length-alpha which has decent results (see here).

  • consult-buffer considerations

    consult-buffer is what the vertico module uses on SPC b B.

    • What should be shown by default?

      Currently it just uses the default settings of showing open buffers, recent files, and bookmarks by default. It’s possible to have it only show buffers by setting the recent files and bookmarks sources to be hidden, or pre-narrowing the command.

    • Org buffer source

      I’ve added a consult source that lets you narrow for org-mode buffers. Originally I did this by autoloading org-buffers-list, but beyond potential snappiness considerations regarding loading org too early, I would also occasionally get nondeterministic void variable errors on org-buffers-list, which I suspect are caused by the use of :defer-incrementally in the org use-package! statement.

      This is currently implemented by only adding the buffer source in an after! org statement, but per minad every additional buffer source slows consult-buffer down, so it is worth consideration if this option is desired at all. I haven’t noticed a difference, but it might be noticible on slower machines.

  • Set embark-quit-after-action to nil?

HACKs that need looking over

  • fboundp issues

    Even if the ivy module isn’t loaded, it’s packages can still get loaded by other means, such as lispy requiring counsel. This means that the fboundp logic in the definition of +default/yank-pop) (and formerly in the definition of doom-project-find-file) won’t work unless the vertico option is checked first, which is what we do for now.

  • projectile-switch-project-action definition

    Without the new projectile-switch-project-action setting (in ui/workspaces/config.el), new projects don’t get opened in a new tab, but the exact working of this whole set up are a bit opaque to me.

Bugs

  • Filtering for editing snippets with C-c & C-v leads to user-error: Couldn’t find a snippet with uuid nil. Might be a continuation of this issue. Works with Ivy.

  • previewing buffers outside of the currently active workspace (e.g. with consult-buffer ) shouldn’t pollute the current workspace with buffers from other workspaces

Things to do

  • Speed up async commands

    SPC / is noticeably slower on vertico than on ivy.

    The gimmies are lowering consult-async-min-input, consult-async-input-debounce, andconsult-async-input-throttle, which are currently at the default settings. They can be lowered with no drawback for small projects, but this may cause issues on larger ones. I think there isn’t currently a way to set these per command, I’ll open an issue about that, seems like it should be a thing.

  • Better Marginalia annotations for Projectile commands (maybe upstream)

  • Fix the duplicate candidate issue

    See here. If this doesn’t get fixed upstream by the time of the merge we should add an override for read-library-name at least.

  • Embark Export/Collect popup logic

    Expand the popup logic to all export and collect buffers after henrik gets a better feel for the whole thing

  • Hide hidden files

    Ivy didn’t show hidden files when filtering if there were visible matches left. I (Gauge) like that it shows hidden files right away, but some people on the discord miss this feature. Should there be a toggle?

  • Go over all the cool new embark stuff that have been happening in the past month and see if any of them are relevant to Doom

Extra credit

  • bibtex-actions improvements?

    Currently SPC n b is bound to a function, but bibtex-actions doesn’t have a main dispatch function like ivy-bibtex, rather it has a bunch of different ones. Binding the bibtex-actions-map there would probably be better, but there are nontrivial loading order shenanigans happening that make that not straightforward.

  • Buffer switching

    • SPC b b should switch workspace after choosing a buffer from a different one
    • Universal argument for opening buffer in another window?
  • Ivy Parity

    • C-RET on minibuffer?

    • pass module

    • +ivy/jump-list analogue

    • [c] lookup module: dash-docs backend

    • lookup module: counsel-search analogue

    • taskrunner module

      in all likelihood requires writing consult-taskrunner.

Teco’s Gripes

What will it take to make him happy? Geez, tough customer.

  • What did my emojis do to you?

    With Ivy, SPC i e worked exactly as expected, with emojify-mode turning incomprehensible squares into nice little emojis. With Vertico though, I’m left with incomprehensible squares :frowning_face_with_open_mouth:.

3 Likes

Decide what Vertico extensions to use

IMO, it makes the most sense to put these behind feature flags, and things like vertico-mouse making sense as a default for gui environments.

Fixed “Embark Export/Correct popup logic” in

Improved Marginalia and Orderless theme integration, SPC s B

1 Like
  • Bind consult-lsp-diagnostics to something (commit)
  • discard C-M-j and C-M-k (commit)
  • use vertico-directory-delete-char instead of +vertico/backward-updir (commit)