Commit graph

1262 commits

Author SHA1 Message Date
9e65bee47e dev: merge branch 'master' 2024-03-09 09:26:07 -05:00
Dev380
d657be1744
feat(vertico): completion highlights a la ivy
* feat(vertico): completion highlights a la ivy

Adds completion highlighting that works similarly to ivy/counsel's
one (which is enabled by default). It'll highlight enabled major/minor
modes and directories in a different face. On by default.

Ref: https://github.com/minad/vertico/wiki#candidate-display-transformations-custom-candidate-highlighting

* fix(vertico): major mode not being highlighted

The major mode was not being highlighted correctly;
it should work now that the buffer is set correctly in
`+vertico-highlight-enabled-mode`.

* fix(vertico): make font lock prioritize match over type

The mode and directory highlights were [overriding the match
font-lock](https://github.com/doomemacs/doomemacs/pull/7706#issuecomment-1977722188).
This should resolve that by prioritizing the match font lock using
`'append` on `add-face-text-property` instead of `propertize`.
2024-03-08 20:21:36 -05:00
f56395956a dev: merge branch 'pr7002' into emenel 2024-03-08 09:06:40 -05:00
Luigi Sartor Piucco
3a001534c1
docs(corfu): add @LemonBreezes as co-maintainer
Co-authored-by: StrawberryTea <look@strawberrytea.xyz>
2024-03-07 21:21:09 -03:00
Luigi Sartor Piucco
69c82bc0f0
refactor(corfu): settings and keybinding overhaul
Previously, a distinction was made only between "regular" style (assumed
to be for people who prefer to cycle directionally and commit with RET)
and +tng (assumed to be for people who prefer TAB and auto-commit). This
made composing further variations harder on the user, as they would have
to work around our bindings. Now we have many features as documentation,
and the user can compose to their liking. The global CAPF list was
pruned, suggesting to use individual keys for those functions if
required.
2024-03-07 21:20:13 -03:00
9b9b54b82a dev: updating from latest 2024-03-05 08:01:17 -05:00
45mm
78b85b8a72 fix(vertico): mapping for embark open in workspace
We should always bind to both "TAB" and "<tab>" - if they have been
mapped to different commands anywhere, Emacs will no longer treat them
as equivalent.
2024-03-05 01:13:39 -05:00
Luigi Sartor Piucco
fb12635864
docs(corfu): add @LemonBreezes as co-maintainer
Co-authored-by: StrawberryTea <look@strawberrytea.xyz>
2024-03-04 14:17:56 -03:00
a85f4d9f6c dev: updating from latest 2024-03-04 12:16:35 -05:00
Luigi Sartor Piucco
8015d3172d
refactor(corfu): settings and keybinding overhaul
Previously, a distinction was made only between "regular" style (assumed
to be for people who prefer to cycle directionally and commit with RET)
and +tng (assumed to be for people who prefer TAB and auto-commit). This
made composing further variations harder on the user, as they would have
to work around our bindings. Now we many features as documentation, and
the user can compose to their liking. The global CAPF list was pruned,
suggesting to use individual keys for those functions if required.
2024-03-04 14:08:32 -03:00
afe9fa896f dev: merge branch 'pr7002' into emenel 2024-03-04 09:48:38 -05:00
Luigi Sartor Piucco
93faae87eb
refactor(corfu): settings and keybinding overhaul
Previously, a distinction was made only between "regular" style (assumed
to be for people who prefer to cycle directionally and commit with RET)
and +tng (assumed to be for people who prefer TAB and auto-commit). This
made composing further variations harder on the user, as they would have
to work around our bindings. Now we many features as documentation, and
the user can compose to their liking. The global CAPF list was pruned,
suggesting to use individual keys for those functions if required.
2024-03-03 16:46:37 -03:00
4102c1f5b6 dev: updating from latest 2024-03-02 12:53:27 -05:00
Luigi Sartor Piucco
03f065df9f
refactor(corfu): settings and keybinding overhaul
Previously, a distinction was made only between "regular" style (assumed
to be for people who prefer to cycle directionally and commit with RET)
and +tng (assumed to be for people who prefer TAB and auto-commit). This
made composing further variations harder on the user, as they would have
to work around our bindings. Now we provide a flag per feature, and the
user can compose to their liking. Some variable options were turned into
flags and the global CAPF list was pruned, suggesting to use individual
keys for those functions if required.
2024-03-02 13:19:17 -03:00
eaa9d0e188 dev: updating from latest 2024-03-01 15:01:17 -05:00
StrawberryTea
2bb5f29a01
feat(corfu): make minibuffer completion optional 2024-03-01 12:33:13 -03:00
StrawberryTea
435c9c9fde
fix(corfu): improve detection of comments
Due to https://github.com/minad/cape/pull/109, we cannot rely on only
faces to detect comments.
2024-03-01 12:33:13 -03:00
StrawberryTea
5b37e90cc8
fix(corfu): complete after colon in lispy 2024-03-01 12:33:12 -03:00
StrawberryTea
9fd2ef892e
fix(corfu): move orderless conf out of corfu block 2024-03-01 12:33:12 -03:00
StrawberryTea
d28f217b93
doc(corfu): document +corfu-want-C-x-bindings 2024-03-01 12:33:12 -03:00
StrawberryTea
1257527537
feat(config): make C-x corfu bindings optional
For someone like me that uses the vanilla emacs commands bound to C-x
C-p, C-x C-n, etc, I prefer to set the completion keybindings manually.
2024-03-01 12:33:11 -03:00
StrawberryTea
7a68375ffb
fix(corfu): bind cape-dabbrev eagerly
Set up cape-dabbrev in completion-at-point-functions before dabbrev is
loaded.
2024-03-01 12:33:11 -03:00
StrawberryTea
e0006ac497
feat(corfu): update minibuffer hints manually
In the scenario where we exit the minibuffer using C-RET or S-RET, we
need this advice to ensure that visual hints are updated before exiting.
2024-03-01 12:33:11 -03:00
StrawberryTea
5ea9c00f30
refactor(corfu): unwrap add-hook from after! block
add-hook handles void variables so there is no need to wrap it in an
after! block. This also makes it easier for the user to remove the hook.
2024-03-01 12:33:11 -03:00
StrawberryTea
7daf8e4e15
fix(corfu): load minibuffer-setup-hook earlier
This way Corfu can be lazily-loaded by the minibuffer-setup-hook.
2024-03-01 12:33:11 -03:00
Luigi Sartor Piucco
70b2e345cc
bump: :completion corfu
minad/corfu@24dccafeea -> minad/corfu@b48d3017a4
minad/cape@18a30f48bb -> minad/cape@bfde79ed44
elken/yasnippet-capf@a0a6b1c2bb -> elken/yasnippet-capf@db12b55cd0
2024-03-01 12:33:10 -03:00
Luigi Sartor Piucco
70c327a4f1
feat(corfu): general move-to-minibuffer impl
We previously implemented only consult/vertico as a target for export,
now we have all of them. It was necessary to use case-by-case
conditions, unfortunately, because other UIs have subtle quirks that
prevent a single generalized approach to work.

Ivy is almost compliant, but it needs beg and end to not be markers.

Helm doesn't replace `completion-in-region-function`, it expects to go
around the default `completion--in-region`, so a small addition was made
to its module, because we weren't doing that. This was likely an
oversight due to the non-standard usage. This was fixed here because we
need it working for this feature.

Ido doesn't implement `completion-in-region` and its `completing-read`
is retricted to a list of strings as table, so it's treated the same as
absence of a framework, because it lacks the needed features.
2024-03-01 12:33:10 -03:00
Luigi Sartor Piucco
a5db530622
feat(corfu): impl smart confirm in minibuffer
An issue when using corfu in the minibuffer was the need for pressing
RET twice, since the first only inserts the completion. This commit
aliviates that by providing C-RET to ignore completion and conclude the
minibuffer imediately and S-RET to insert completion then conclude.
2024-03-01 12:33:10 -03:00
Luigi Sartor Piucco
14a3eaaa02
fix(corfu): move binds to :config default
Bindings were moved to the `:config default` module and some keys were
adjusted to match Company/other modules. The changes were documented in
the README.
2024-03-01 12:33:10 -03:00
Luigi Sartor Piucco
b3bd325000
feat(corfu,vertico): use equal orderless config
This removes the old `&` separator for Vertico (does anyone use that
instead of just space?) in favor of escapable space and unifies
orderless config with Corfu. Also implements smart separator
insert/escape/reset on `C-SPC`

Co-authored-by: Liam Hupfer <liam@hpfr.net>
2024-03-01 12:33:10 -03:00
StrawberryTea
b239de123c
feat(corfu): more CAPFs and ergonomy changes
Add various CAPFs from cape:
- `cape-dabbrev`;
- `cape-emoji`;
- `cape-dict`;
Fixed some CAPFs via cape:
- Make non-exclusive, purified and silent `pcomplete-completions-at-point`;
- Make non-exclusive and non-interruptable `lsp-completion-at-point`;
- Make non-exclusive `eglot-completion-at-point`;
- Make non-exclusive `comint-completion-at-point`;
Fix and improve keybindings:
- Smart `DEL`/`backspace` for `+tng`;
- Smart `RET`;
Add depth to CAPFs, allowing ordering to be adjustable.
Enable in minibuffer.
2024-03-01 12:33:10 -03:00
Luigi Sartor Piucco
a866bf82f6
feat(corfu): add snippets
Yasnippet is now properly integrated! A previosly-unset default has now
been given to `corfu-on-exact-match`. With snippets, it causes immediate
expansion upon single match by default, so we set it to nil and
recommend against changing it in the README.
2024-03-01 12:33:10 -03:00
Luigi Sartor Piucco
c6b7eb6e7c
module: add :completion corfu
This commit's primary goal is allowing use of
[minad/corfu](https://github.com/minad/corfu) as an alternative to
[company](https://github.com/company-mode/company-mode). It introduces a
module under :completion for this purpose, plus some conditionals on
other relevant modules to toggle functionality like lsp back-ends and
[minad/cape](https://github.com/minad/cape) capfs for certain modes.

Other optional or miscellaneous features include:

- Support for displaying the completion's documentation on a secondary
  popup;
- Support for terminal display if :os tty;
- Support for icons if +icons;
- Support for tab-and-go completion if +tng;
2024-03-01 12:33:09 -03:00
StrawberryTea
40518d932a feat(corfu): make minibuffer completion optional 2024-03-01 12:29:45 -03:00
StrawberryTea
a85b61dc0c fix(corfu): improve detection of comments
Due to https://github.com/minad/cape/pull/109, we cannot rely on only
faces to detect comments.
2024-03-01 12:29:45 -03:00
StrawberryTea
fb985684e3 fix(corfu): complete after colon in lispy 2024-03-01 12:29:45 -03:00
StrawberryTea
dd65e57a3a fix(corfu): move orderless conf out of corfu block 2024-03-01 12:29:45 -03:00
7325a2dc42 dev: updating from latest 2024-02-20 19:00:42 -05:00
StrawberryTea
345f7f575b doc(corfu): document +corfu-want-C-x-bindings 2024-02-20 07:50:24 -03:00
01878b82d2 dev: merge branch 'pr7002' into emenel 2024-02-19 14:42:51 -05:00
StrawberryTea
39b0de8736 feat(config): make C-x corfu bindings optional
For someone like me that uses the vanilla emacs commands bound to C-x
C-p, C-x C-n, etc, I prefer to set the completion keybindings manually.
2024-02-19 16:29:22 -03:00
StrawberryTea
3b275b271a fix(corfu): bind cape-dabbrev eagerly
Set up cape-dabbrev in completion-at-point-functions before dabbrev is
loaded.
2024-02-19 16:29:22 -03:00
StrawberryTea
b2c1b574e2 feat(corfu): update minibuffer hints manually
In the scenario where we exit the minibuffer using C-RET or S-RET, we
need this advice to ensure that visual hints are updated before exiting.
2024-02-19 16:29:22 -03:00
StrawberryTea
775749c4cf refactor(corfu): unwrap add-hook from after! block
add-hook handles void variables so there is no need to wrap it in an
after! block. This also makes it easier for the user to remove the hook.
2024-02-19 16:29:22 -03:00
StrawberryTea
86e5994003 fix(corfu): load minibuffer-setup-hook earlier
This way Corfu can be lazily-loaded by the minibuffer-setup-hook.
2024-02-19 16:29:22 -03:00
Luigi Sartor Piucco
2776fa2c4b
bump: :completion corfu
minad/corfu@24dccafeea -> minad/corfu@b48d3017a4
minad/cape@18a30f48bb -> minad/cape@bfde79ed44
elken/yasnippet-capf@a0a6b1c2bb -> elken/yasnippet-capf@db12b55cd0
2024-02-18 17:52:39 -03:00
Luigi Sartor Piucco
159f61a3a1
feat(corfu): general move-to-minibuffer impl
We previously implemented only consult/vertico as a target for export,
now we have all of them. It was necessary to use case-by-case
conditions, unfortunately, because other UIs have subtle quirks that
prevent a single generalized approach to work.

Ivy is almost compliant, but it needs beg and end to not be markers.

Helm doesn't replace `completion-in-region-function`, it expects to go
around the default `completion--in-region`, so a small addition was made
to its module, because we weren't doing that. This was likely an
oversight due to the non-standard usage. This was fixed here because we
need it working for this feature.

Ido doesn't implement `completion-in-region` and its `completing-read`
is retricted to a list of strings as table, so it's treated the same as
absence of a framework, because it lacks the needed features.
2024-02-18 17:52:39 -03:00
Luigi Sartor Piucco
a4c9c4cc44
feat(corfu): impl smart confirm in minibuffer
An issue when using corfu in the minibuffer was the need for pressing
RET twice, since the first only inserts the completion. This commit
aliviates that by providing C-RET to ignore completion and conclude the
minibuffer imediately and S-RET to insert completion then conclude.
2024-02-18 17:51:46 -03:00
Luigi Sartor Piucco
73090187d7
fix(corfu): move binds to :config default
Bindings were moved to the `:config default` module and some keys were
adjusted to match Company/other modules. The changes were documented in
the README.
2024-02-18 17:50:21 -03:00
17b109158d dev: merge branch 'pr7002' into emenel 2024-02-18 11:02:23 -05:00