开发者

Autocompletion based on filenames in a directory

开发者 https://www.devze.com 2022-12-27 18:37 出处:网络
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 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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号