mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-05 01:46:46 +01:00
[wd] v0.3.1: Improved completion and bug fixes
This commit is contained in:
parent
c925aabea9
commit
346f6b7d24
4 changed files with 114 additions and 92 deletions
|
|
@ -5,23 +5,16 @@ zstyle ':completion::complete:wd:*:commands' group-name commands
|
|||
zstyle ':completion::complete:wd:*:warp_points' group-name warp_points
|
||||
zstyle ':completion::complete:wd::' list-grouped
|
||||
|
||||
# Call `_wd()` when when trying to complete the command `wd`
|
||||
|
||||
zmodload zsh/mapfile
|
||||
|
||||
function _wd() {
|
||||
local ret=1
|
||||
local CONFIG=$HOME/.warprc
|
||||
|
||||
# Stolen from
|
||||
# http://stackoverflow.com/questions/9000698/completion-when-program-has-sub-commands
|
||||
|
||||
# local curcontext="$curcontext" state line
|
||||
# typeset -A opt_args
|
||||
local ret=1
|
||||
|
||||
local -a commands
|
||||
local -a warp_points
|
||||
warp_points=( "${(f)mapfile[$CONFIG]}" )
|
||||
# LIST="${mapfile[$FNAME]}" # Not required unless stuff uses it
|
||||
|
||||
warp_points=( "${(f)mapfile[$CONFIG]//$HOME/~}" )
|
||||
|
||||
commands=(
|
||||
'add:Adds the current working directory to your warp points'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue