{"id":165,"date":"2019-05-18T10:02:01","date_gmt":"2019-05-18T01:02:01","guid":{"rendered":"https:\/\/blog.hgrs.me\/?p=165"},"modified":"2020-05-12T21:19:41","modified_gmt":"2020-05-12T12:19:41","slug":"macos%e3%81%a7z-shell%ef%bc%88zsh%ef%bc%89%e3%80%81prezto%e3%82%92%e4%bd%bf%e3%81%88%e3%82%8b%e3%82%88%e3%81%86%e3%81%ab%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/blog.hgrs.me\/archives\/165.html","title":{"rendered":"macOS\u3067Z shell\uff08zsh\uff09\u3068Prezto\u3092\u4f7f\u3048\u308b\u3088\u3046\u306b\u3059\u308b"},"content":{"rendered":"

\u306f\u3058\u3081\u306b<\/h2>\n

\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u7cfb\u306e\u8a71\u3067\u3059\u3002<\/p>\n

\u524d\u306b\u3082\u66f8\u3044\u305f\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u50d5\u306fGUI\u304c\u597d\u304d\u3067CUI\u306f\u3042\u307e\u308a\u597d\u304d\u3067\u306f\u306a\u3044\u306e\u3067\u3059\u304c\u3001\u73fe\u72b6\u4f7f\u308f\u3056\u308b\u3092\u5f97\u306a\u3044\u72b6\u6cc1\u304c\u591a\u3044\u3067\u3059\u3002<\/p>\n

\u3069\u3046\u305b\u4f7f\u3046\u306a\u3089\u4f7f\u3044\u3084\u3059\u304f\u3057\u305f\u3044\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u50d5\u306e\u4f7f\u3063\u3066\u308b\u74b0\u5883\u69cb\u7bc9\u3092\u6652\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n

\u524d\u6e96\u5099<\/h2>\n

\u6700\u65b0\u306ezsh\u3092\u5165\u308c\u308b\u305f\u3081\u306bHomebrew<\/a>\u3092\u5c0e\u5165\u3057\u307e\u3059\u3002\u3059\u3067\u306b\u5165\u3063\u3066\u308b\u4eba\u306f\u30b9\u30ad\u30c3\u30d7\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n

\u4ee5\u4e0b\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30b3\u30de\u30f3\u30c9<\/p>\n

$ \/usr\/bin\/ruby -e "$(curl -fsSL https:\/\/raw.githubusercontent.com\/Homebrew\/install\/master\/install)"<\/code><\/pre>\n

zsh\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7<\/h2>\n

zsh\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n

\u307e\u305a\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n

$ brew install zsh<\/code><\/pre>\n

zsh\u3092\u4f7f\u3048\u308b\u3088\u3046\u306b\u3059\u308b<\/h3>\n

\u6b21\u306b\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305fzsh\u3092\u30b7\u30a7\u30eb\u306e\u30ea\u30b9\u30c8\u306b\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n

\u3053\u3061\u3089\u306f\/etc\/shells<\/code>\u306b\/usr\/local\/bin\/zsh<\/code>\u3092\u66f8\u304d\u52a0\u3048\u307e\u3059\u3002\u597d\u304d\u306a\u30a8\u30c7\u30a3\u30bf\u3067\u66f8\u304d\u8fbc\u3093\u3067\u3082\u826f\u3044\u3067\u3059\u3057\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u3082\u66f8\u304d\u52a0\u3048\u3089\u308c\u307e\u3059\u3002<\/p>\n

$ echo \/usr\/local\/bin\/zsh | sudo tee -a \/etc\/shells<\/code><\/pre>\n

\u30ed\u30b0\u30a4\u30f3\u30b7\u30a7\u30eb\u3092zsh\u306b\u5909\u66f4<\/h3>\n

\u6700\u5f8c\u306b\u30ed\u30b0\u30a4\u30f3\u30b7\u30a7\u30eb\u3092zsh\u306b\u5909\u66f4\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n

$ chsh -s \/usr\/local\/bin\/zsh<\/code><\/pre>\n

\u4ee5\u4e0a\u3067zsh\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u7d42\u308f\u308a\u3067\u3059\u3002\u30bf\u30fc\u30df\u30ca\u30eb\u3092\u518d\u8d77\u52d5\u3059\u308b\u304bzsh<\/code>\u3068\u3059\u308c\u3070\u3001zsh\u304c\u4f7f\u3048\u307e\u3059\u3002<\/p>\n

Prezto\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7<\/h2>\n

Prezto\u3068\u306f<\/h3>\n

\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u76f4\u5f8c\u306e\u4f55\u3082\u8a2d\u5b9a\u3057\u3066\u3044\u306a\u3044zsh\u3067\u306f\u5fc3\u8a31\u306a\u3044\u306e\u3067\u5f37\u304f\u3059\u308b\u305f\u3081\u306bPrezto<\/a>\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n

Prezto\u3092\u5165\u308c\u308b\u3053\u3068\u3067\u3001.zshrc<\/code>\u306b\u8272\u3005\u66f8\u304b\u306a\u304f\u3066\u3082\u3001\u88dc\u5b8c\u306e\u5f37\u5316\u3084\u30d7\u30ed\u30f3\u30d7\u30c8\u306e\u30c6\u30fc\u30de\u8a2d\u5b9a\u7b49\u306e\u9762\u5012\u306a\u3053\u3068\u3092\u826f\u3057\u306a\u306b\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n

Prezto\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n

\u307e\u305a\u3001git<\/code>\u3067\u30d5\u30a1\u30a4\u30eb\u7fa4\u3092\u6301\u3063\u3066\u304d\u307e\u3059\u3002<\/p>\n

$ git clone --recursive https:\/\/github.com\/sorin-ionescu\/prezto.git "${ZDOTDIR:-$HOME}\/.zprezto"<\/code><\/pre>\n

\u6b21\u306b\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u4f5c\u6210\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n

\u2193\u306f1\u3064\u306e\u30b3\u30de\u30f3\u30c9\u306a\u306e\u3067\u30014\u884c\u4e38\u3054\u3068\u30b3\u30d4\u30da\u3067\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n

$ setopt EXTENDED_GLOB\nfor rcfile in "${ZDOTDIR:-$HOME}"\/.zprezto\/runcoms\/^README.md(.N); do\n  ln -s "$rcfile" "${ZDOTDIR:-$HOME}\/.${rcfile:t}"\ndone<\/code><\/pre>\n

\u4ee5\u4e0a\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n

\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u7d42\u4e86\u3059\u308b\u3068zsh\u306e\u30d7\u30ed\u30f3\u30d7\u30c8\u306b3\u8272\u306e\u77e2\u5370\u304c\u8868\u793a\u3055\u308c\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n

Prezto\u306e\u30d7\u30ed\u30f3\u30d7\u30c8\u30c6\u30fc\u30de\u5909\u66f4<\/h3>\n

\u500b\u4eba\u7684\u306b\u3042\u307e\u308a\u521d\u671f\u306e\u30d7\u30ed\u30f3\u30d7\u30c8\u306e\u30c6\u30fc\u30de\u304c\u597d\u304d\u3067\u306f\u306a\u304b\u3063\u305f\u306e\u3067\u3001~\/.zpreztorc<\/code>\u3092\u5909\u66f4\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n

\u74b0\u5883\u3084\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u3088\u3063\u3066\u591a\u5c11\u884c\u6570\u306f\u524d\u5f8c\u3059\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c110\u884c\u3042\u305f\u308a\u304b\u3089\u30d7\u30ed\u30f3\u30d7\u30c8\u306e\u8a2d\u5b9a\u304c\u66f8\u3044\u3066\u3042\u308a\u307e\u3059\u3002\u305d\u3053\u306e\u30c6\u30fc\u30de\u306e\u8a2d\u5b9a\uff08\u50d5\u306e\u74b0\u5883\u3067\u306f116\u884c\u76ee\uff09\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u66f8\u304d\u63db\u3048\u307e\u3059\uff08powerline\u306f\u50d5\u304c\u9078\u3093\u3060\u30c6\u30fc\u30de\u306a\u306e\u3067\u3001\u3053\u306e\u90e8\u5206\u3092\u81ea\u5206\u306e\u597d\u307f\u306e\u30c6\u30fc\u30de\u306b\u66f8\u304d\u63db\u3048\u307e\u3059\u3002\u30c6\u30fc\u30de\u4e00\u89a7\u306fprompt -p<\/code>\u3067\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\uff09\u3002<\/p>\n

- zstyle ':prezto:module:prompt' theme 'sorin'\n+ zstyle ':prezto:module:prompt' theme 'powerline'<\/code><\/pre>\n

\u3053\u3053\u3067\u6ce8\u610f\u3057\u305f\u3044\u306e\u306f\u3001powerline\u3067\u306f\u7279\u6b8a\u306a\u30d5\u30a9\u30f3\u30c8\u3092\u4f7f\u7528\u3059\u308b\u305f\u3081\u3001\u30bf\u30fc\u30df\u30ca\u30eb\u3067\u4f7f\u7528\u3059\u308b\u30d5\u30a9\u30f3\u30c8\u3092\u5909\u66f4\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u3053\u3068\u3067\u3059\u3002\u597d\u304d\u306a\u30d5\u30a9\u30f3\u30c8\u306epowerline\u7248\u3092\u63a2\u3057\u3066\u30a4\u30f3\u30b9\u30fc\u30eb\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\uff01<\/p>\n

\u304a\u308f\u308a\u306b<\/h2>\n

Prezto\u3092\u5165\u308c\u308c\u3070\u3001\u57fa\u672c\u7684\u306a\u4f7f\u3044\u3084\u3059\u3055\u304c\u5411\u4e0a\u3057\u307e\u3059\u304c\u3001\u7d30\u304b\u306a\u8a2d\u5b9a\u306f\u81ea\u5206\u3067.zshrc<\/code>\u306b\u66f8\u3044\u3066\u3044\u304d\u3001\u81ea\u5206\u7528\u306b\u80b2\u3066\u3066\u3044\u304d\u307e\u3057\u3087\u3046\uff01<\/p>\n

\u3042\u307e\u308a\u66f8\u304d\u8fbc\u3093\u3067\u306f\u3044\u307e\u305b\u3093\u304c\u3001\u50d5\u306e.zshrc<\/code>\u306f\u3053\u3053<\/a>\u3067\u6652\u3057\u3066\u307e\u3059\u3002<\/p>\n

\u3053\u3093\u3060\u3051\u66f8\u3044\u3066\u304a\u3044\u3066\u5b9f\u306fXonsh\u304c\u6c17\u306b\u306a\u3063\u3066\u3001\u65b0\u3057\u304f\u5165\u308c\u3066\u307f\u305f\u306e\u306f\u79d8\u5bc6<\/del><\/p>\n","protected":false},"excerpt":{"rendered":"

\u306f\u3058\u3081\u306b \u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u7cfb\u306e\u8a71\u3067\u3059\u3002 \u524d\u306b\u3082\u66f8\u3044\u305f\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u50d5\u306fGUI\u304c\u597d\u304d\u3067CUI\u306f\u3042\u307e\u308a\u597d\u304d…<\/p>\n","protected":false},"author":1,"featured_media":176,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[26],"_links":{"self":[{"href":"https:\/\/blog.hgrs.me\/wp-json\/wp\/v2\/posts\/165"}],"collection":[{"href":"https:\/\/blog.hgrs.me\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.hgrs.me\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.hgrs.me\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.hgrs.me\/wp-json\/wp\/v2\/comments?post=165"}],"version-history":[{"count":12,"href":"https:\/\/blog.hgrs.me\/wp-json\/wp\/v2\/posts\/165\/revisions"}],"predecessor-version":[{"id":248,"href":"https:\/\/blog.hgrs.me\/wp-json\/wp\/v2\/posts\/165\/revisions\/248"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.hgrs.me\/wp-json\/wp\/v2\/media\/176"}],"wp:attachment":[{"href":"https:\/\/blog.hgrs.me\/wp-json\/wp\/v2\/media?parent=165"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.hgrs.me\/wp-json\/wp\/v2\/categories?post=165"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.hgrs.me\/wp-json\/wp\/v2\/tags?post=165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}