Commit graph

1262 commits

Author SHA1 Message Date
3daf85b919 dev: merging from main and pr7339 2024-03-29 10:46:41 -04:00
Henrik Lissner
b533f5496c
tweak(corfu): corfu-auto-delay: 0.1 -> 0.18
At 0.1, Corfu pops up too aggressively and too often, even for fast
typists. This is especially disruptive with slow backends that might
block Emacs. I think 0.18-0.24 is the goldilocks zone, so I'll start
with 0.18, and maybe increase it later.
2024-03-28 16:58:28 -04:00
d02c7a8b4c dev: merge branch 'master' into emenel 2024-03-25 09:20:09 -04:00
Henrik Lissner
18c88621a4
refactor(vertico): don't use bind-key
This is the only internal usage of :bind, which I want to avoid, because
it pulls in bind-key, which offers no real benefit over just about any
other key binding function or macro, so I'd rather use what is already
available (like map!).
2024-03-24 18:03:12 -04:00
c5fb8007b0 dev: merge branch 'pr7739' into emenel 2024-03-22 08:10:53 -04:00
ab7216f40a dev: merging from master 2024-03-21 11:48:50 -04:00
StrawberryTea
a83091469b
docs(corfu): debugging cape-dabbrev 2024-03-21 11:29:50 -04:00
Sean Farley
2bdeabb0cf refactor(corfu): consolidate +orderless logic without vertico
This tidy ups the corfu module to use the logic when a user enables
corfu +orderless without enabling vertico. Since that's probably a niche
situation, we only specify commit to pin to orderless in the vertico
module so that contributors aren't tripped up with trying to remember to
update orderless in two different code locations. Of course, if this
turns out to be a more popular use-case we can re-evaluate this logic.
2024-03-21 11:29:32 -04:00
Sean Farley
d3a00ba6af nit(vertico): fix spelling in some docstrings 2024-03-21 11:29:19 -04:00
Sean Farley
222dc47060 feat(vertico): add orderless annotation filtering
Ref: oantolin/orderless#162
2024-03-21 11:29:19 -04:00
StrawberryTea
8c82a90003 feat(corfu): update smart tab completion
This commit updates the smart tab functionality so that:
1. The only functionality checked is for the modules that are enabled.
2. The priority of the TAB behavior is tunable by the user.

This also updates the TAB behavior for the Corfu module to be
`indent-for-tab-command` instead of `completion-at-point` so that users
can use the TAB key to indent their code and navigating Org tables.

We also address #7372 by checking overriding-terminal-local-map, as that
is used by Embark.
2024-03-21 09:33:30 -05:00
831e2c7402 dev: merge branch 'master' into emenel 2024-03-20 13:23:14 -04:00
Henrik Lissner
d22fa5a670
fix(vertico): consult-dir: don't guess user from containers
The tramp string used to connect to the container uses the first
`container-runtime ps` argument as a username, but the first argument
returned is the container ID, not a username.

Close: #7674
Co-authored-by: bergmannf <bergmannf@users.noreply.github.com>
Co-authored-by: elken <elken@users.noreply.github.com>
2024-03-20 03:09:05 -04:00
Henrik Lissner
0ea84d1c3b
feat(vertico): add consult-yasnippet
Close: #7471
Co-authored-by: LemonBreezes <LemonBreezes@users.noreply.github.com>
2024-03-20 00:16:29 -04:00
Henrik Lissner
7547cdac6d
refactor(corfu): remove redundant setting
Upstream, corfu-preview-current is already 'insert by default.
2024-03-19 21:49:23 -04:00
Henrik Lissner
c9c221ca59
fix(corfu): wrong-type-argument characterp error
Corfu doesn't support a nil corfu-separator in general, but
+corfu-smart-sep-toggle-escape, specifically, will throw a characterp
type error if the user hasn't enabled +orderless.
2024-03-19 21:46:31 -04:00
Henrik Lissner
b52d2b2dd0
fix(corfu): ispell: only complain once per session 2024-03-19 21:43:15 -04:00
Henrik Lissner
875cd1aef9
fix(corfu): gate corfu-terminal config
If :completion corfu users don't have :os tty enabled, loading
corfu-terminal will throw an error in TTY Emacs.
2024-03-19 21:42:37 -04:00
Henrik Lissner
9447e82074
bump: :completion vertico
minad/consult-flycheck@d83f87581a -> minad/consult-flycheck@754f5497d8
minad/consult@9463146ba7 -> minad/consult@b48ff6bf05
minad/marginalia@ea356ebb1d -> minad/marginalia@f6fe86b989
minad/vertico@4a7da56b02 -> minad/vertico@68cbd47589
oantolin/embark@60139db879 -> oantolin/embark@c93abadc82
oantolin/orderless@b24748093b -> oantolin/orderless@dc7a781acf
2024-03-19 21:10:45 -04:00
Luigi Sartor Piucco
f9c0243211
docs(corfu): add @LemonBreezes as co-maintainer
Co-authored-by: StrawberryTea <look@strawberrytea.xyz>
2024-03-19 20:41:50 -03:00
StrawberryTea
bfb9aabe27
feat(corfu): update minibuffer hints manually
We need this advice to ensure that visual hints are updated before
exiting.
2024-03-19 20:41:50 -03:00
StrawberryTea
4192c81113
feat(corfu): make minibuffer completion optional 2024-03-19 20:41:50 -03:00
Luigi Sartor Piucco
763464afdb
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`. It's supposed to add the
advice by itself, but it's very unreliable, so we do the wrapping
manually.

Ido doesn't implement `completion-in-region` and its `completing-read`
is retricted to a list of strings as table, so we use default
`completion--in-region` with no bells or whistles.
2024-03-19 20:41:50 -03:00
Luigi Sartor Piucco
0588b42b46
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-19 20:41:50 -03:00
StrawberryTea
365a95de76
feat(corfu): more CAPFs and ergonomy changes
Add CAPFs from cape:
- `cape-dabbrev`;
- `cape-elisp-block`;
- `cape-file`;
Fix 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`;
Add depth to CAPFs, allowing ordering to be adjustable.
2024-03-19 20:41:50 -03:00
Luigi Sartor Piucco
968a897530
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-19 20:41:50 -03:00
Luigi Sartor Piucco
6949451b00
module: add :completion corfu
This commit's primary goal is allowing use of
[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
[Cape](https://github.com/minad/cape) capfs for certain modes.

Other optional or miscellaneous features include:

- Corfu is enabled in the minibuffer if `completion-at-point` is bound;
- Support for displaying the completion's documentation on a secondary
  popup;
- Support for terminal display if :os tty;
- Support for icons if +icons;
2024-03-19 20:41:36 -03:00
87daad531e dev: merge branch 'pr7002' into emenel 2024-03-13 10:57:38 -04:00
Luigi Sartor Piucco
600ebf8b01
docs(corfu): add @LemonBreezes as co-maintainer
Co-authored-by: StrawberryTea <look@strawberrytea.xyz>
2024-03-12 18:18:34 -03:00
Luigi Sartor Piucco
9e7967c909
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-12 18:18:33 -03:00
StrawberryTea
3aa1ea74d9
feat(corfu): make minibuffer completion optional 2024-03-12 18:18:33 -03:00
StrawberryTea
d0127025a0
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-12 18:18:33 -03:00
StrawberryTea
a1ba1593fc
fix(corfu): complete after colon in lispy 2024-03-12 18:18:32 -03:00
StrawberryTea
14f350a3da
fix(corfu): move orderless conf out of corfu block 2024-03-12 18:18:32 -03:00
StrawberryTea
881c45bd05
doc(corfu): document +corfu-want-C-x-bindings 2024-03-12 18:18:32 -03:00
StrawberryTea
fa1979d97f
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-12 18:18:31 -03:00
StrawberryTea
42f48ace69
fix(corfu): bind cape-dabbrev eagerly
Set up cape-dabbrev in completion-at-point-functions before dabbrev is
loaded.
2024-03-12 18:18:31 -03:00
StrawberryTea
f3729174bd
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-12 18:18:31 -03:00
StrawberryTea
0ea6968f74
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-12 18:18:31 -03:00
StrawberryTea
b54c64bc21
fix(corfu): load minibuffer-setup-hook earlier
This way Corfu can be lazily-loaded by the minibuffer-setup-hook.
2024-03-12 18:18:31 -03:00
Luigi Sartor Piucco
a2e76be3a9
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-12 18:18:30 -03:00
Luigi Sartor Piucco
956b85310c
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-12 18:18:30 -03:00
Luigi Sartor Piucco
d666dcd713
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-12 18:18:30 -03:00
Luigi Sartor Piucco
7bbef94854
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-12 18:18:30 -03:00
Luigi Sartor Piucco
8ef4ce6311
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-12 18:18:30 -03:00
StrawberryTea
948f2b7705
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-12 18:18:29 -03:00
Luigi Sartor Piucco
8ed223c98e
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-12 18:18:29 -03:00
Luigi Sartor Piucco
5532c68e53
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-12 18:18:29 -03:00
Dev380
7018cb45fb
fix(vertico): disable minor mode highlight duly
Minor mode highlights did not disable as long
as the mode was enabled.

Amend: #7706
2024-03-10 00:54:06 -05:00
6b57ada323 dev: merge branch 'pr7339' into emenel 2024-03-09 09:26:27 -05:00