Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic completion #406

Closed
wants to merge 2 commits into from
Closed

Conversation

psprint
Copy link
Contributor

@psprint psprint commented Oct 31, 2022

Description

Complete plugin ids at any position in the command line via Alt-Shift-A and ices via Alt-Shift-C. Both keys are unbound by default, and can be customized via two zstyles, e.g.:

zstyle ":zinit:action-complete:plugin-id" key '^f'
zstyle ":zinit:action-complete:ice" key '^a'

Motivation and Context

Current normal completion doesn't work with for-syntax – it'll not complete plugin id for, e.g.:

zi for zdh<TAB>

While the new, action-complete, will work at any position.

Related Issue(s)

Closes #331.

Usage examples

zi for june/<Alt-A> →zi  for junegunn/fzf

See: https://asciinema.org/a/3bzyTIEXN4iNiDLyRAARcDypt

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@psprint
Copy link
Contributor Author

psprint commented Oct 31, 2022

I've also added a description to README.

@psprint
Copy link
Contributor Author

psprint commented Nov 5, 2022

Could the PR be merged?

@psprint psprint force-pushed the dynamic-completion branch from d141d5e to 452b095 Compare December 1, 2022 15:20
@psprint
Copy link
Contributor Author

psprint commented Dec 10, 2022

Could the PR be merged?

Alias all plugins with ~plgname to point to their directory.
@psprint psprint force-pushed the dynamic-completion branch 2 times, most recently from e1291fa to 883275a Compare December 23, 2022 12:11
@psprint
Copy link
Contributor Author

psprint commented Dec 23, 2022

I've cleanup the PR (squash and 'feat:" prefix), could it be merged?

One will be able to obtain, e.g.:

zinit fzf<Alt>-<Shift>-A
    » zinit junegunn/fzf
zinit cd rip<Alt>-<Shift>-A
    » zinit cd BurntSushi/ripgrep

and so on. The <Alt>-<Shift>-A shortcut works with ALL commands,
regardless if it's zinit command or not.

Two autoloaded functions added, ziactioncomplete (the proper imple-
mentation of the main features) and ziprocessbuffer (a very useful
library function that takes care of $BUFFFER/$CURSOR processing).

Also Feature: Cycling and ice-completion (<Alt>-<Shift>-C).

Cycling will allow to choose a particular match, say for, e.g.:
zinit at<Alt>-<Shift>-C
    »   zinit atclone<Alt><Shift>-C
    » zinit atinit<Alt>-<Shift>-C
@psprint
Copy link
Contributor Author

psprint commented Dec 24, 2022

Is there any obstacle to merge the commit? It's an isolated change – active at prompt, live – it cannot break anything…

@psprint
Copy link
Contributor Author

psprint commented Dec 24, 2022

@vladdoster @pschmitt @jankatins ping

@psprint
Copy link
Contributor Author

psprint commented Dec 26, 2022

@vladdoster Could the PR be merged as an Xmas gift? A mention of this could be added to README.md.

@psprint
Copy link
Contributor Author

psprint commented Dec 26, 2022

@vladdoster @pschmitt @jankatins ping for merging this PR, presentation:

https://asciinema.org/a/547978

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant