about summary refs log tree commit diff
path: root/Completion/Commands/_expand_word
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Commands/_expand_word')
-rw-r--r--Completion/Commands/_expand_word26
1 files changed, 26 insertions, 0 deletions
diff --git a/Completion/Commands/_expand_word b/Completion/Commands/_expand_word
new file mode 100644
index 000000000..570f06987
--- /dev/null
+++ b/Completion/Commands/_expand_word
@@ -0,0 +1,26 @@
+#compdef -k complete-word \C-xe
+
+# Simple completion front-end implementing expansion.
+#
+# If configurations keys with the prefix `expandword_' are
+# given they override those starting with `expand_'.
+
+local oes="$compconfig[expand_substitute]"
+local oeg="$compconfig[expand_glob]"
+local oem="$compconfig[expand_menu]"
+local oeo="$compconfig[expand_original]"
+local oep="$compconfig[expand_prompt]"
+
+compconfig[expand_substitute]="${compconfig[expandword_substitute]}"
+compconfig[expand_glob]="${compconfig[expandword_glob]-$oeg}"
+compconfig[expand_menu]="${compconfig[expandword_menu]-$oem}"
+compconfig[expand_original]="${compconfig[expandword_original]-$oeo}"
+compconfig[expand_prompt]="${compconfig[expandword_prompt]-$oep}"
+
+_main_complete _expand
+
+compconfig[expand_substitute]="$oes"
+compconfig[expand_glob]="$oeg"
+compconfig[expand_menu]="$oem"
+compconfig[expand_original]="$oeo"
+compconfig[expand_prompt]="$oep"