Autocompletion based on filenames in a directory
I want to have a function in my zsh for faster accessing my todo-files. It s开发者_高级运维hould look inside the folder ~/tasks
where i put my todo-lists and stuff. Now i want to type task p
and when I hit tab, it should use the files in that directory for autocompletition. Can anyone point me some direction? Or share some snippet to work with?
Thanks
This would seem to do the trick:
compdef '_files -W "$HOME/tasks"' task
精彩评论