summaryrefslogtreecommitdiff
path: root/plugins/fd
diff options
context:
space:
mode:
authorMarc Cornellà <marc.cornella@live.com>2019-05-08 20:40:36 +0200
committerGitHub <noreply@github.com>2019-05-08 20:40:36 +0200
commit0232ac4bb1cb64b5bfaa7e5fc979d6f7ab23e534 (patch)
tree946d9f8b758ebdd63da96152ca56b154c99068da /plugins/fd
parentafb028763cf40fc339e49011b2cba124dc108fcb (diff)
parentebc700be9b2fa7ae770a644093a5c46a8e323726 (diff)
downloadzsh-0232ac4bb1cb64b5bfaa7e5fc979d6f7ab23e534.tar.gz
zsh-0232ac4bb1cb64b5bfaa7e5fc979d6f7ab23e534.tar.bz2
zsh-0232ac4bb1cb64b5bfaa7e5fc979d6f7ab23e534.zip
Merge branch 'master' into master
Diffstat (limited to 'plugins/fd')
-rw-r--r--plugins/fd/README.md13
-rw-r--r--plugins/fd/_fd83
2 files changed, 96 insertions, 0 deletions
diff --git a/plugins/fd/README.md b/plugins/fd/README.md
new file mode 100644
index 000000000..aabd624b8
--- /dev/null
+++ b/plugins/fd/README.md
@@ -0,0 +1,13 @@
+# fd
+
+This plugin adds completion for the file search tool [`fd`](https://github.com/sharkdp/fd), also known as `fd-find`.
+
+To use it, add `fd` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... fd)
+```
+
+Completion is taken from the fd release [`7.3.0`](https://github.com/sharkdp/fd/releases/tag/v7.3.0).
+
+Updated on Febrary 13th, 2019.
diff --git a/plugins/fd/_fd b/plugins/fd/_fd
new file mode 100644
index 000000000..7a4c38753
--- /dev/null
+++ b/plugins/fd/_fd
@@ -0,0 +1,83 @@
+#compdef fd fdfind
+
+autoload -U is-at-least
+
+_fd() {
+ typeset -A opt_args
+ typeset -a _arguments_options
+ local ret=1
+
+ if is-at-least 5.2; then
+ _arguments_options=(-s -S -C)
+ else
+ _arguments_options=(-s -C)
+ fi
+
+ local context curcontext="$curcontext" state line
+ _arguments "${_arguments_options[@]}" \
+'-d+[Set maximum search depth (default: none)]' \
+'--max-depth=[Set maximum search depth (default: none)]' \
+'--maxdepth=[See --max-depth]' \
+'*-t+[Filter by type: file (f), directory (d), symlink (l),
+executable (x), empty (e)]: :(f file d directory l symlink x executable e empty)' \
+'*--type=[Filter by type: file (f), directory (d), symlink (l),
+executable (x), empty (e)]: :(f file d directory l symlink x executable e empty)' \
+'*-e+[Filter by file extension]' \
+'*--extension=[Filter by file extension]' \
+'-x+[Execute a command for each search result]' \
+'--exec=[Execute a command for each search result]' \
+'(-x --exec)-X+[Execute a command with all search results at once]' \
+'(-x --exec)--exec-batch=[Execute a command with all search results at once]' \
+'*-E+[Exclude entries that match the given glob pattern]' \
+'*--exclude=[Exclude entries that match the given glob pattern]' \
+'*--ignore-file=[Add a custom ignore-file in .gitignore format]' \
+'-c+[When to use colors: never, *auto*, always]: :(never auto always)' \
+'--color=[When to use colors: never, *auto*, always]: :(never auto always)' \
+'-j+[Set number of threads to use for searching & executing]' \
+'--threads=[Set number of threads to use for searching & executing]' \
+'*-S+[Limit results based on the size of files.]' \
+'*--size=[Limit results based on the size of files.]' \
+'--max-buffer-time=[the time (in ms) to buffer, before streaming to the console]' \
+'--changed-within=[Filter by file modification time (newer than)]' \
+'--changed-before=[Filter by file modification time (older than)]' \
+'*--search-path=[(hidden)]' \
+'-H[Search hidden files and directories]' \
+'--hidden[Search hidden files and directories]' \
+'-I[Do not respect .(git|fd)ignore files]' \
+'--no-ignore[Do not respect .(git|fd)ignore files]' \
+'--no-ignore-vcs[Do not respect .gitignore files]' \
+'*-u[Alias for no-ignore and/or hidden]' \
+'-s[Case-sensitive search (default: smart case)]' \
+'--case-sensitive[Case-sensitive search (default: smart case)]' \
+'-i[Case-insensitive search (default: smart case)]' \
+'--ignore-case[Case-insensitive search (default: smart case)]' \
+'-F[Treat the pattern as a literal string]' \
+'--fixed-strings[Treat the pattern as a literal string]' \
+'-a[Show absolute instead of relative paths]' \
+'--absolute-path[Show absolute instead of relative paths]' \
+'-L[Follow symbolic links]' \
+'--follow[Follow symbolic links]' \
+'-p[Search full path (default: file-/dirname only)]' \
+'--full-path[Search full path (default: file-/dirname only)]' \
+'-0[Separate results by the null character]' \
+'--print0[Separate results by the null character]' \
+'--show-errors[Enable display of filesystem errors]' \
+'-h[Prints help information]' \
+'--help[Prints help information]' \
+'-V[Prints version information]' \
+'--version[Prints version information]' \
+'::pattern -- the search pattern, a regular expression (optional):_files' \
+'::path -- the root directory for the filesystem search (optional):_files' \
+&& ret=0
+
+}
+
+(( $+functions[_fd_commands] )) ||
+_fd_commands() {
+ local commands; commands=(
+
+ )
+ _describe -t commands 'fd commands' commands "$@"
+}
+
+_fd "$@"