From ab41c4484d3f3734a85a575e8d496406313ae274 Mon Sep 17 00:00:00 2001 From: Eric Nielsen Date: Sat, 15 Dec 2018 16:54:32 -0500 Subject: [PATCH] [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`. --- modules/completion/README.md | 14 ++++++++++++-- modules/completion/init.zsh | 8 ++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/modules/completion/README.md b/modules/completion/README.md index 8cd2581..7024fd3 100644 --- a/modules/completion/README.md +++ b/modules/completion/README.md @@ -3,9 +3,19 @@ completion Enables and configures smart and extensive tab completion. -Completions are sourced from [zsh-completions](https://github.com/zsh-users/zsh-completions). +Completions are sourced from [zsh-completions][zsh-completions]. + +Zsh options +----------- + + * `ALWAYS_TO_END` moves cursor to end of word if a full completion is inserted. + * `PATH_DIRS` performs path search even on command names with slashes in them. + * `NO_CASE_GLOB` makes globbing case insensitive. + * `NO_LIST_BEEP` doesn't beep on ambiguous completions. Contributing ------------ -Command completions should be submitted [upstream to zsh-completions](https://github.com/zsh-users/zsh-completions). +Command completions should be submitted [upstream to zsh-completions][zsh-completions]. + +[zsh-completions]: https://github.com/zsh-users/zsh-completions diff --git a/modules/completion/init.zsh b/modules/completion/init.zsh index 4b56d8b..437c9a6 100644 --- a/modules/completion/init.zsh +++ b/modules/completion/init.zsh @@ -23,18 +23,18 @@ autoload -Uz compinit && compinit -C -d "${ZDOTDIR:-${HOME}}/${zcompdump_file:-. # zsh options # -# If a completion is performed with the cursor within a word, and a full completion is inserted, -# the cursor is moved to the end of the word +# If a completion is performed with the cursor within a word, and a full +# completion is inserted, the cursor is moved to the end of the word. setopt ALWAYS_TO_END # Perform a path search even on command names with slashes in them. setopt PATH_DIRS # Make globbing (filename generation) not sensitive to case. -unsetopt CASE_GLOB +setopt NO_CASE_GLOB # Don't beep on an ambiguous completion. -unsetopt LIST_BEEP +setopt NO_LIST_BEEP #