Also replace undohist with undo-fu-session.
Overall this seems to yield a more reliable undo history, as undo-fu and
vundo supposedly operate with vanilla emacs undo history state, while
undo-tree supposedly does some custom tweaks to the undo state.
Move away from the whitespace-cleanup-mode package, and instead simply
define our own whitespace-cleanup-on-save-mode minor-mode that uses a
before-save-hook.
This applies especially in lsp-mode. Yasnippet snippets now show as
completion candidates if the word at point exactly matches a snippet
keyword, otherwise it'll fallback to normal lsp backed completion.
And it also supports completing file/directory names now too while
lsp-mode is active.
All this is done by modifying completion-at-point-functions after
lsp-mode has done it's trickery with it. Along with a dirty hack to
company-yasnippet to make it only activate on exact matches. Without
this hack, lsp backed completion rarely activates as snippets would have
higher priority if there's any partial matches.
Using consult-buffer to switch between buffers is now project aware,
meaning when current buffer is in a project, the list of buffers is
split into two groups; project buffers, and other non-project buffers.
The project buffers group is above the other buffers group, meaning it's
very easy to switch to other buffers within the same project, while
still being able to switch to non-project buffers too.
When current buffer is not part of a project, all buffers are shown
together in a single completion group.
Occasionally right after starting Emacs, it was possible to issue a
projectile-switch-project command which ran before my hacky
vertico-directory advice had been added. This should ensure the advice
gets added earlier.
Override default straight recipe for vertico to expose extensions as
packages.
Also create hacky vertico-directory-mode to easily toggle
vertico-directory features on and off.
vertico-directory-mode is then used by a projectile advice to
temporarily disable vertico-directory features while completing results
from projectile. This is required to avoid breaking the
projectile-switch-project and related commands, as the project list is
not a set of files, but vertico-directory-enter thinks it is.
I finally resolved the lsp-mode bug I had whenever I tried vertico in
the past. It was due to me setting resize-mini-windows instead of
vertico-resize.
This is useful for annotating completion-read buffer results which all
belong to a single project, as it removes the project root from the
file path field, showing a relative path to each buffer's file from the
project root.
Personally I find orderless is giving me better results than prescient
when fuzzy/flex matching is enabled. Hence the switch to orderless.
I also split the modules apart to ensure, that selectrum, vertico,
prescient and orderless can be mixed and matched however and work
correctly.
And the switch from to vertico from selectrum is mostly cause I like
it's wraparound/cycle feature, where end/beginning of the candidate list
will wrap around.
The default 'marginalia-annotate-command annotation method for M-x
candidates has a small but perceivable performance impact as you
type. The 'marginalia-annotate-binding method does not have any
perceivable performance impact.
Also I only really care about seeing keybindings in the M-x list, I can
definitely live without command descriptions.
This is a basic setup, as I'm not very familiar with what is doable with
embark. It also takes over the goto-chg keybindings, cause that package
rarely worked correctly, so I almost never used it.
Packages that need to be loaded on emacs startup, should just be loaded
through use-package in a non-deferred manner.
It makes no real difference to startup, loading the packages either
slows down emacs before "startup" is complete, or right after it
completes. End result is that Emacs is unresponsive for basically the
same amount of time regardless.
The folding indicators in the fringe haven't been working when clicked
for some time now. And they also take precedence over other things
displayed in the fringe like git status.
Instead of directly using the my current favorite indentation
highlighting package in various places, only use the
siren-display-indentation function. This lets me control it from a
single central place.
I'm not fully convinced with swapping out ido with selectrum, so I'll
add the configuration for both, without actually loading them, and
instead manually try them out from time to time.
Also, make ivy use prescient for filtering and sorting, as it does a
much better job than ivy itself does by default. But nothing currently
uses ivy either, so it's more for future if I start using ivy somewhere.
Smex has not been updated since late 2015. Amx was originally a fork of
smex, but as since evolved much further into it's own thing.
Among other things is supports other completing backends, and ivy with
it's fuzzy matching feels rather nice. I'm keeping ido-mode for
everything else, but specifically for M-x I'll give ivy a try.