Browse Source

[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`.
Eric Nielsen 5 years ago
parent
commit
ab41c4484d
2 changed files with 16 additions and 6 deletions
  1. 12 2
      modules/completion/README.md
  2. 4 4
      modules/completion/init.zsh

+ 12 - 2
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

+ 4 - 4
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
 
 
 #