mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-06-05 05:03:16 +02:00
Revert "JShell07's local pull request"
This commit is contained in:
parent
43922c02f9
commit
663b3b4691
97 changed files with 709 additions and 2226 deletions
|
|
@ -16,19 +16,6 @@ function _wd() {
|
|||
|
||||
warp_points=( "${(f)mapfile[$CONFIG]//$HOME/~}" )
|
||||
|
||||
typeset -A points
|
||||
while read -r line
|
||||
do
|
||||
arr=(${(s,:,)line})
|
||||
name=${arr[1]}
|
||||
target_path=${arr[2]}
|
||||
|
||||
# replace ~ from path to fix completion (#17)
|
||||
target_path=${target_path/#\~/$HOME}
|
||||
|
||||
points[$name]=$target_path
|
||||
done < $CONFIG
|
||||
|
||||
commands=(
|
||||
'add:Adds the current working directory to your warp points'
|
||||
'add!:Overwrites existing warp point'
|
||||
|
|
@ -47,15 +34,13 @@ function _wd() {
|
|||
'1: :->first_arg' \
|
||||
'2: :->second_arg' && ret=0
|
||||
|
||||
local target=$words[2]
|
||||
|
||||
case $state in
|
||||
first_arg)
|
||||
_describe -t warp_points "Warp points" warp_points && ret=0
|
||||
_describe -t commands "Commands" commands && ret=0
|
||||
;;
|
||||
second_arg)
|
||||
case $target in
|
||||
case $words[2] in
|
||||
add\!|rm)
|
||||
_describe -t points "Warp points" warp_points && ret=0
|
||||
;;
|
||||
|
|
@ -71,10 +56,6 @@ function _wd() {
|
|||
path)
|
||||
_describe -t points "Warp points" warp_points && ret=0
|
||||
;;
|
||||
*)
|
||||
# complete sub directories from the warp point
|
||||
_path_files -W "(${points[$target]})" -/ && ret=0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue