Commit Graph

18 Commits

Author SHA1 Message Date
Eric Nielsen ab41c4484d [completion] Add options to README.md
Prefer `setopt NO_FOO` instead of `unsetopt FOO`, as former is easier to
document in the README.

Stick with the following style for the README:

* Header 1 with the module name is in `lowercase`.
* Other headers are in `Sentence case`. Common header names that should
  be consistently used are `Aliases`, `Contributing`, `Functions`,
  `Settings`, and `Zsh options`.
2018-12-15 16:54:32 -05:00
Eric Nielsen 35c5daf791
[pacman] Remove dependency from completion module
The completion module has specific code for the pacman module, and we
want to make modules independent from each other.

Plus, as far as I checked, most of the pacman wrappers/frontends are
already packaged with zsh completion out of the box. I'm not an Arch
user, but I checked the repos of the ones in
https://wiki.archlinux.org/index.php/AUR_helpers#Pacman_wrappers and
these contain zsh completion scripts:

* aura: https://github.com/aurapm/aura/blob/master/aura/doc/completions/_aura
* pacaur: https://github.com/rmarquis/pacaur/blob/master/zsh.completion
* pakku: https://github.com/kitsunyan/pakku/blob/master/completion/zsh.patch
* pikaur: https://github.com/actionless/pikaur/blob/master/packaging/usr/share/zsh/site-functions/_pikaur
* trizen: https://github.com/trizen/trizen/blob/master/zsh.completion
* yay: https://github.com/Jguer/yay/blob/master/completions/zsh

I didn't find zsh completions for the ones listed below, so I added a
compdef function for them inside the pacman module itself:

* aurman
* packer-aur
* wrapaur
* yaourt

Closes #296
2018-10-01 08:17:22 -05:00
Matt Hamilton 2436a6da28 [completion] Fix ssh completion for ~/.ssh/config
I think this change results in the _expected_ behavior. Users can always
override this by overriding the zstyle, as that is a benefit of using
zstyles.

Ref: https://www.zsh.org/mla/users/2015/msg00467.html

and `which _ssh_hosts`

Fixes #46. Closes #294.
2018-09-27 14:26:26 -05:00
Eric Nielsen e70bee54f3 [completion] Update init.zsh and README.md
and use local string variable instead of "hardcoding" the string inside
`${}`.
2018-05-24 20:37:16 -05:00
AtomicCoding a9828a8097 [completion] LS_COLORS independent of utility module
Completion module can now be loaded from an arbitrary location.

Closes #275
2018-05-24 20:15:27 -05:00
Eric Nielsen 56b61e211d [completion] Simplify matcher-list syntax
Refactor using `+` instead of repeating the case insensitive pattern.
2018-04-03 08:57:30 -05:00
Eric Nielsen e1a2a38a0f [completion] Prefer left-matching before fuzzy
all still being case insensitive.

Having just fuzzy matching returns too many matches in the average case.
2018-03-23 08:36:16 -05:00
Eric Nielsen 98eef4184a [completion] Improve fuzzy completion matching
This will present the menu in case of ambiguous matches, and also expand
by any separator, not just `[._-]`.

Based on the configuration suggested at
https://superuser.com/a/815317/637926

Closes #212
2018-03-22 11:41:21 -05:00
Eric Nielsen 017ff99851 [completion] Don't beep on an ambiguous completion
Remove beep when completion is shown. We don't want that to sound like
an error.
2018-03-01 08:25:33 +01:00
Eric Nielsen cfdf36d76b [completion] Ask when completion list is long
To achieve this, we have to make sure that the following is not set:
* `zstyle ':completion:*:default' list-prompt '...'`

otherwise long completion lists will be paginated (without prompting).

The list is considered too long when it's greater than `${LISTMAX}`,
which has a value of 100 by default.

Also remove options being set (or unset) that are already the default,
namely:
* `AUTO_MENU <D>`
* `AUTO_LIST (-9) <D>`
* `MENU_COMPLETE (-Y)`

And remove the space character from the beginning of the messages.

Fixes #136. Closes #248
2018-03-01 08:25:33 +01:00
Eric Nielsen bc742f0023
[completion] Remove smart editor completion
as Vim can open archives, and Emacs can virtually open everything  :- )

I suggest we don't try to be smart here.

Closes #229
2017-11-29 09:06:41 -05:00
Eric Nielsen 8ba34e68e5 [completion] Don't zcompile the zcompdump file
as this is already being done in `zlogin`. Centralizing all the
compilation in one place.

Closes #218
2017-11-24 19:08:20 -05:00
Matt Hamilton 4ac66646c4 [completion] add ${zcompdump_file} option
This commit assumes that the user-provided variable for the filename
will start with '.zcomp'. This is used in the .zlogin for zcompiling the
completion file. Sourcing the .zimrc file within the .zlogin file is
something I'd rather not do, and this seems like a good compromise. If
this becomes an issue, the file can be sourced an the var can be used
instead.

Closes #42
2016-04-16 14:56:53 -07:00
Matt Hamilton b6b3620f34 not in a function; remove local 2015-12-28 01:56:07 -05:00
Matt Hamilton a1a56ac63f use consistent variable style 2015-12-19 09:48:29 -05:00
Matt Hamilton 01838f0083 add compdef for pacman aliases
The recommended order for the module loading has been changed. The last
module to be loaded should be 'completion'. This ensures all completions
set by other modules are dumped and included in the completion.
Because of this, any compdefs like this one (making the pacman aliases
use pacman completion) must be set in the compdefs.zsh file, and loaded
with the completion module. This means the compdefs must be wrapped with
conditional statements to ensure such aliases/functions have been set by
previous modules. I may abstract this conditional to a function in the
future to make this an easier process.
2015-12-17 03:06:12 -05:00
Matt Hamilton 2f9b8437e2 It is probably better to prepend ranther than append 2015-12-16 14:56:54 -05:00
Matt Hamilton 3a62391e0e initial commit 2015-12-15 00:12:17 -05:00