c7c11e110a738bbd34dc022fabe73f47c0f42b78

Author
Marc Cornellà <marc@mcornella.com>
Committer
Marc Cornellà <marc@mcornella.com>
Date

Message

refactor(fd): remove `fd` completion plugin (#12576)

BREAKING CHANGE: the `fd` plugin has been removed, as it only shipped its
completion, which is now already included in all the usual package managers.

Diff

This diff is truncated to protect this page.

  1diff --git a/plugins/fd/README.md b/plugins/fd/README.md
  2deleted file mode 100644
  3index f3341612f2aa78ad3a540531789ae894438f04d7..0000000000000000000000000000000000000000
  4--- a/plugins/fd/README.md
  5+++ /dev/null
  6@@ -1,9 +0,0 @@
  7-# fd
  8-
  9-This plugin adds completion for the file search tool [`fd`](https://github.com/sharkdp/fd), also known as `fd-find`.
 10-
 11-To use it, add `fd` to the plugins array in your zshrc file:
 12-
 13-```zsh
 14-plugins=(... fd)
 15-```
 16diff --git a/plugins/fd/_fd b/plugins/fd/_fd
 17deleted file mode 100644
 18index 45b8ca47763b97531684ae295e612ab08206dbb9..0000000000000000000000000000000000000000
 19--- a/plugins/fd/_fd
 20+++ /dev/null
 21@@ -1,273 +0,0 @@
 22-#compdef fd
 23-
 24-##
 25-# zsh completion function for fd
 26-#
 27-# Based on ripgrep completion function.
 28-# Originally based on code from the zsh-users project — see copyright notice
 29-# below.
 30-
 31-autoload -U is-at-least
 32-
 33-_fd() {
 34-  local curcontext="$curcontext" no='!' ret=1
 35-  local -a context line state state_descr _arguments_options fd_types fd_args
 36-  local -A opt_args
 37-
 38-  if is-at-least 5.2; then
 39-    _arguments_options=( -s -S )
 40-  else
 41-    _arguments_options=( -s )
 42-  fi
 43-
 44-  fd_types=(
 45-    {f,file}'\:"regular files"'
 46-    {d,directory}'\:"directories"'
 47-    {l,symlink}'\:"symbolic links"'
 48-    {e,empty}'\:"empty files or directories"'
 49-    {x,executable}'\:"executable (files)"'
 50-    {s,socket}'\:"sockets"'
 51-    {p,pipe}'\:"named pipes (FIFOs)"'
 52-  )
 53-
 54-  # Do not complete rare options unless either the current prefix
 55-  # matches one of those options or the user has the `complete-all`
 56-  # style set. Note that this prefix check has to be updated manually to account
 57-  # for all of the potential negation options listed below!
 58-  if
 59-    # (--[bpsu]* => match all options marked with '$no')
 60-    [[ $PREFIX$SUFFIX == --[bopsu]* ]] ||
 61-    zstyle -t ":complete:$curcontext:*" complete-all
 62-  then
 63-    no=
 64-  fi
 65-
 66-  # We make heavy use of argument groups here to prevent the option specs from
 67-  # growing unwieldy. These aren't supported in zsh <5.4, though, so we'll strip
 68-  # them out below if necessary. This makes the exclusions inaccurate on those
 69-  # older versions, but oh well — it's not that big a deal
 70-  fd_args=(
 71-    + '(hidden)' # hidden files
 72-    {-H,--hidden}'[search hidden files/directories]'
 73-
 74-    + '(no-ignore-full)' # all ignore files
 75-    '(no-ignore-partial)'{-I,--no-ignore}"[don't respect .(git|fd)ignore and global ignore files]"
 76-    $no'(no-ignore-partial)*'{-u,--unrestricted}'[alias for --no-ignore, when repeated also alias for --hidden]'
 77-
 78-    + no-ignore-partial # some ignore files
 79-    "(no-ignore-full --no-ignore-vcs)--no-ignore-vcs[don't respect .gitignore files]"
 80-    "!(no-ignore-full --no-global-ignore-file)--no-global-ignore-file[don't respect the global ignore file]"
 81-    $no'(no-ignore-full --no-ignore-parent)--no-ignore-parent[]'
 82-
 83-    + '(case)' # case-sensitivity
 84-    {-s,--case-sensitive}'[perform a case-sensitive search]'
 85-    {-i,--ignore-case}'[perform a case-insensitive search]'
 86-
 87-    + '(regex-pattern)' # regex-based search pattern
 88-    '(no-regex-pattern)--regex[perform a regex-based search (default)]'
 89-
 90-    + '(no-regex-pattern)' # non-regex-based search pattern
 91-    {-g,--glob}'[perform a glob-based search]'
 92-    {-F,--fixed-strings}'[treat pattern as literal string instead of a regex]'
 93-
 94-    + '(match-full)' # match against full path
 95-    {-p,--full-path}'[match the pattern against the full path instead of the basename]'
 96-
 97-    + '(follow)' # follow symlinks
 98-    {-L,--follow}'[follow symbolic links to directories]'
 99-
100-    + '(abs-path)' # show absolute paths
101-    '(long-listing)'{-a,--absolute-path}'[show absolute paths instead of relative paths]'
102-
103-    + '(null-sep)' # use null separator for output
104-    '(long-listing)'{-0,--print0}'[separate search results by the null character]'
105-
106-    + '(long-listing)' # long-listing output
107-    '(abs-path null-sep max-results exec-cmds)'{-l,--list-details}'[use a long listing format with file metadata]'
108-
109-    + '(max-results)' # max number of results
110-    '(long-listing exec-cmds)--max-results=[limit number of search results to given count and quit]:count'
111-    '(long-listing exec-cmds)-1[limit to a single search result and quit]'
112-
113-    + '(fs-errors)' # file-system errors
114-    $no'--show-errors[enable the display of filesystem errors]'
115-
116-    + '(fs-traversal)' # file-system traversal
117-    $no"--one-file-system[don't descend into directories on other file systems]"
118-    '!--mount'
119-    '!--xdev'
120-