summary refs log tree commit diff
path: root/Functions/Completion/_files
diff options
context:
space:
mode:
Diffstat (limited to 'Functions/Completion/_files')
-rw-r--r--Functions/Completion/_files10
1 files changed, 10 insertions, 0 deletions
diff --git a/Functions/Completion/_files b/Functions/Completion/_files
new file mode 100644
index 000000000..ab3006e39
--- /dev/null
+++ b/Functions/Completion/_files
@@ -0,0 +1,10 @@
+#autoload
+
+# Utility function for completing files of a given type or any file.
+# In many cases you will want to call this one instead of _path_files().
+
+local nm=$NMATCHES
+
+_path_files "$@"
+
+[[ $# -ne 0 && -nmatches nm ]] && _path_files