3 zstyle ':completion::complete:wd:*:descriptions' format '%B%d%b'
4 zstyle ':completion::complete:wd:*:commands' group-name commands
5 zstyle ':completion::complete:wd:*:warp_points' group-name warp_points
6 zstyle ':completion::complete:wd::' list-grouped
11 local WD_CONFIG=${WD_CONFIG:-$HOME/.warprc}
17 warp_points=( "${(f)mapfile[$WD_CONFIG]//$HOME/~}" )
26 # replace ~ from path to fix completion (#17)
27 target_path=${target_path/#\~/$HOME}
29 points[$name]=$target_path
33 'add:Adds the current working directory to your warp points'
34 'add!:Overwrites existing warp point'
35 'export:Export warp points as static named directories'
36 'rm:Removes the given warp point'
37 'list:Outputs all stored warp points'
38 'ls:Show files from given warp point'
39 'path:Show path to given warp point'
40 'show:Outputs all warp points that point to the current directory or shows a specific target directory for a point'
41 'help:Show this extremely helpful text'
42 'clean:Remove points warping to nonexistent directories'
43 'clean!:Remove nonexistent directories without confirmation'
44 '..:Go back to last directory'
49 '2: :->second_arg' && ret=0
51 local target=$words[2]
55 _describe -t warp_points "Warp points" warp_points && ret=0
56 _describe -t commands "Commands" commands && ret=0
61 _describe -t points "Warp points" warp_points && ret=0
64 _message 'Write the name of your warp point' && ret=0
67 _describe -t points "Warp points" warp_points && ret=0
70 _describe -t points "Warp points" warp_points && ret=0
73 _describe -t points "Warp points" warp_points && ret=0
76 if [[ -v points[$target] ]]; then
77 # complete sub directories from the warp point
78 _path_files -W "(${points[$target]})" -/ && ret=0
81 # don't complete anything if warp point is not valid
95 # indent-tabs-mode: nil
98 # vim: ft=zsh sw=2 ts=2 et