zshã§Enterãããã³ã«git statusã表示ãããã¤ã便å©ããã
çµæã¤ã¡ã¼ã¸
ãããã
- .zshrcã«ããã追è¨
## enterããããæã«ls & git status function do_enter() { if [ -n "$BUFFER" ]; then zle accept-line return 0 fi echo echo -e "\e[0;33m--- ls ---\e[0m" ls # âãããã # ls_abbrev if [ "$(git rev-parse --is-inside-work-tree 2> /dev/null)" = 'true' ]; then echo echo -e "\e[0;33m--- git status ---\e[0m" git status -sb echo " " fi zle reset-prompt return 0 } zle -N do_enter bindkey '^m' do_enter
ç¶ã
- ããã«æ¸ãã¦ãã£ãã®ãçä¼¼ããã
ãããã¾è©±
ç§ã¯shellã«ã¤ãã¦ã¾ã£ãã詳ãããªãã®ã§ãshellã®ãµã³ãã«ã³ã¼ããèªãã§ãæå³ãåãããªãäºããããããããæã¯ãæå³ãåãããªãè¡ãã¨ããããåé¤ãã¦åä½ãã©ãå¤ããã確èªãã¦ã¿ã¦ããã ï¼ãã¡ãããåé¡ãçºçãã¦ã大ä¸å¤«ãªç¶æ³ã«ããä¸ã§ï¼
ããããã¨ãã©ããªå¹æãæã£ã¦ããè¨è¿°ãªã®ãããç解ã§ããå ´åãå¤ãã
ãªã«ãããã«ä¼¼ããã®ããã£ããªã¨æã£ãããããã¯ã¢ã¦ããã¦ã¹ã ã£ãã