Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: tab completion in an alias



On Feb 25,  2:12pm, Peter Stephenson wrote:
}
} zle-line-init() {
}   if [[ -n $ZLE_PUSH_STRING ]]; then
}     zle -U "$ZLE_PUSH_STRING"
}     unset ZLE_PUSH_STRING
}   fi
} }
} zle -N zle-line-init
} alias d="ZLE_PUSH_STRING=\$'cd -\\C-i'"

I like that approach, but it doesn't work very well unless your 
zstyles etc. send you directly into menu selection on the first
tab.  It should also perhaps check whether the directory stack is
(not) empty before proceeding.

Using an alias for this seems a little strange in the first place,
because it shouldn't need to run as a command; e.g., you'd never
need/want to prime zle-line-init this way inside a "while" loop.

I'd probably do this with a "select" command to present the menu,
but then you don't get a fancy curses-based arrow-key interface.



Messages sorted by: Reverse Date, Date, Thread, Author