zshã®ããã©ã«ãã®è£å®ã®å®ç¾©ã使ããªããã¨ã«ãã
zshã§ä»¥ä¸ã®ããã«è¨å®ãã¦ããã¨
autoload -Uz compinit
compinit
æ§ã ãªè£å®ãããã©ã«ãã§å®ç¾©ããã¾ãããã»ã¨ãã©ã®å®ç¾©ã¯èªåã«ã¯ä¸è¦ã§ãããã¨ãæè¿åãã£ã¦ãã¾ããã
ããã
make ãã¡ã¤ã«å
ã¨å®è¡ãããã®ã«ãã¡ã¤ã«åãè£å®ã§ããªããªã©ãä¸ä¾¿ãªç¹ã®ã»ããç®ç«ã¡ã¾ãã
compinit ãè¡ããªããã°ããã©ã«ãã®è£å®ãå®ç¾©ãããªãã®ã§ä¸è¨ã®ãããªä¸ä¾¿ã¯ãªãã®ã§ããããã®ä»£ããè£å®åè£ã«è²ãä»ããªããªã£ã¦ãã¾ãã®ã§ããã¯ããã§ä¸ä¾¿ã§ãã
ããã§ãcompinit ãå®è¡ããä¸ã§ä¸è¦ãªå®ç¾©ãã°ã£ããåé¤ãããã¨ã«ãã¾ããã
autoload -Uz compinit compinit # ã»ã¨ãã©ã®è£å®ã®å®ç¾©ãåé¤ããã # special contexts ã®å®ç¾©ã®ã¿æ®ã (see: man zshcompsys) fix_comp_assoc() { local var=$1 shift for key in "$argv[@]"; do case $key in -redirect-,\<,*) unset "${var}[$key]";; -redirect-,\>,*) unset "${var}[$key]";; -value-,-*) ;; -value-,*) unset "${var}[$key]";; -*) ;; *) unset "${var}[$key]";; esac done } fix_comp_assoc _comps "${(k)_comps[@]}" fix_comp_assoc _services "${(k)_services[@]}" fix_comp_assoc _patcomps "${(k)_patcomps[@]}" fix_comp_assoc _postpatcomps "${(k)_postpatcomps[@]}"
compinit ã§ã¯ãè£å®ããæã«ã©ã®ãããªã³ã³ããã¹ãã§ã©ã®ã³ãã³ããå©ç¨ããã¨ããä¸è¦§ã¯ _comps, _services, _patcomps, _postpatcomps ã¨ããé£æ³é åã«æ ¼ç´ãããããã§ã*1ãããã§ããããã®å®ç¾©ã®ä¸ãã special contexts ã®å®ç¾©ä»¥å¤ãã°ã£ããåãããã«ãã¾ããã
ããã§
make ãã¡ã¤ã«å
ãå®è¡å¯è½ã«ãªããå¿«é©zshã©ã¤ããéããã¨ãã§ãããã§ãã
# ãããããã£ã¨è¯ãããããããããããªãã®ã§ããâ¦
*1:ãããã®å¤æ°ã®ããã©ã«ãã®å 容㯠~/.zcompdump ã¸ãã³ãããã¦ããã®ã§ããã§ç¢ºèªããã®ã楽ã§ã