{"id":5145,"date":"2020-10-28T16:27:10","date_gmt":"2020-10-28T07:27:10","guid":{"rendered":"https:\/\/learningbox.co.jp\/?p=5145"},"modified":"2020-10-28T16:28:11","modified_gmt":"2020-10-28T07:28:11","slug":"blog_zsh-prezto","status":"publish","type":"post","link":"https:\/\/learningbox.co.jp\/en\/2020\/10\/28\/blog_zsh-prezto\/","title":{"rendered":"Make your terminal cool with zsh and prezto"},"content":{"rendered":"<p>\u958b\u767a\u90e8\u306e\u4e0a\u689d\u3067\u3059\u3002<br \/>\n\u53bb\u5e74\u304f\u3089\u3044\u306emacOS\u300cCatalina\u300d\u304b\u3089\u30c7\u30d5\u30a9\u30eb\u30c8shell\u304czsh\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n\u4f1a\u793e\u3067\u306fwindows\u3001\u81ea\u5b85\u3067\u306fmac\u4f7f\u7528\u3057\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001wsl\u306ebash\u3068zsh\u3067\u306f\u4f7f\u3044\u52dd\u624b\u304c\u9055\u3046\u306e\u3067<br \/>\n\u4eca\u56de\u306fwsl(ubuntu)\u306bzsh\u306e\u5c0e\u5165\u3068prezto\u306e\u5c0e\u5165\u3092\u3057\u3066\u30bf\u30fc\u30df\u30ca\u30eb\u3092\u304b\u3063\u3053\u3088\u304f\uff1f\u3057\u3066\u307f\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p class=\"mokujimidasi\">\u76ee\u6b21\u306f\u3053\u3061\u3089<\/p>\n<ul class=\"mokuji\">\n<li>\uff11. zsh\u5c0e\u5165<\/li>\n<li>\uff12. prezto\u5c0e\u5165<\/li>\n<li>\uff13. \u30c6\u30fc\u30de\u3092\u9078\u3076<\/li>\n<li>\uff14. \u6700\u5f8c\u306b<\/li>\n<\/ul>\n<h2 id=\"zsh%E5%B0%8E%E5%85%A5\">zsh\u5c0e\u5165<\/h2>\n<p><code>apt install zsh<\/code><\/p>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3059\u308b\u3068<\/p>\n<p><code>zsh<\/code><\/p>\n<p>\u3067\u30b7\u30a7\u30eb\u304c\u5207\u308a\u66ff\u3048\u3089\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u3067\u3059\u304c\u3001\u6bce\u56de\u5207\u308a\u66ff\u3048\u308b\u306e\u306f\u9762\u5012\u306a\u306e\u3067\u30ed\u30b0\u30a4\u30f3\u30b7\u30a7\u30eb\u3092\u5909\u66f4\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><code>which zsh<\/code><\/p>\n<p>\u3067 \u300c\/usr\/bin\/zsh\u300d\u3068\u304b\u304c\u51fa\u308b\u3068\u601d\u3044\u307e\u3059\u306e\u3067<\/p>\n<p><code>chsh<\/code><\/p>\n<p>\u3067\u30ed\u30b0\u30a4\u30f3\u30b7\u30a7\u30eb\u3092\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<p><code>Enter the new value, or press ENTER for the default<br \/>\n        Login Shell [\/bin\/bash]: \/user\/bin\/zsh <span class=\"hljs-string\">\"&lt;&lt; \u3053\u3053\u306b\u3055\u3063\u304d\u3067\u305f\u5185\u5bb9\u3092\u5165\u529b<br \/>\n<\/span><\/code><\/p>\n<p>\u3053\u308c\u3067\u30ed\u30b0\u30a4\u30f3\u30b7\u30a7\u30eb\u306e\u5909\u66f4\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002<\/p>\n<h2 id=\"prezto%E5%B0%8E%E5%85%A5\">prezto\u5c0e\u5165<\/h2>\n<p>\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u30af\u30ed\u30fc\u30f3\u3057\u307e\u3059\u3002<\/p>\n<p><code>git clone --recursive https:\/\/github.com\/sorin-ionescu\/prezto.git &quot;${ZDOTDIR:-$HOME}\/.zprezto&quot;<\/code><\/p>\n<p>zsh\u306eEXTENDED_GLOB\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p><code>setopt EXTENDED_GLOB<\/code><\/p>\n<p>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p><code><span class=\"hljs-keyword\">for<\/span> rcfile <span class=\"hljs-keyword\">in<\/span> <span class=\"hljs-string\">\"<span class=\"hljs-variable\">${ZDOTDIR:-$HOME}<\/span>\"<\/span>\/.zprezto\/runcoms\/^README.md(.N); <span class=\"hljs-keyword\">do<\/span><br \/>\n  ln -s <span class=\"hljs-string\">\"<span class=\"hljs-variable\">$rcfile<\/span>\"<\/span> <span class=\"hljs-string\">\"<span class=\"hljs-variable\">${ZDOTDIR:-$HOME}<\/span>\/.<span class=\"hljs-variable\">${rcfile:t}<\/span>\"<\/span><br \/>\n<span class=\"hljs-keyword\">done<\/span><br \/>\n<\/code><\/p>\n<p>\u30b7\u30a7\u30eb\u518d\u8d77\u52d5<\/p>\n<p><code>exec $SHELL -l<\/code><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/tatsuno-system.co.jp\/wp-content\/uploads\/2020\/10\/zsh1.png\"><\/p>\n<p>\u753b\u50cf\u306e\u3088\u3046\u306b\u306a\u308c\u3070\u6210\u529f\u3067\u3059\u3002<\/p>\n<h2 id=\"%E3%83%86%E3%83%BC%E3%83%9E%E3%82%92%E9%81%B8%E3%81%B6\">\u30c6\u30fc\u30de\u3092\u9078\u3076<\/h2>\n<p><code>prompt -p<\/code><\/p>\n<p>\u3067\u30c6\u30fc\u30de\u3092preview\u3067\u304d\u307e\u3059\u3002<br \/>\n\u4f7f\u7528\u3057\u305f\u3044\u30c6\u30fc\u30de\u304c\u6c7a\u307e\u3063\u305f\u3089\u300ctheme\u300d\u3068\u5fc5\u8981\u3067\u3042\u308c\u3070\u300cparameter\u300d\u3092\u30e1\u30e2\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u300c~\/.zpreztorc\u300d \u306b\u30c6\u30fc\u30de\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p><code>vim ~\/.zpreztorc<\/code><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/tatsuno-system.co.jp\/wp-content\/uploads\/2020\/10\/zsh2.png\"><\/p>\n<p>119\u884c\u76ee\u3042\u305f\u308a\u306b<\/p>\n<p><code>zstyle ':prezto:module:prompt' theme 'sorin'<\/code><\/p>\n<p>\u3068\u3044\u3046\u306e\u304c\u3042\u308b\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u5148\u307b\u3069\u3081\u3082\u3057\u305f\u300ctheme\u300d\u3068\u300cparam\u300d\u3092\u3053\u3053\u306b\u5165\u529b\u3057\u307e\u3059\u3002<\/p>\n<p>\u4f8b\uff1a theme: fade param: blue\u306e\u5834\u5408<\/p>\n<p><code>zstyle ':prezto:module:prompt' theme 'fade' 'blue'<\/code><\/p>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067\u66f8\u304d\u63db\u3048\u3066\u4e0b\u3055\u3044\u3002<br \/>\n\u30b7\u30a7\u30eb\u518d\u8d77\u52d5\u3057\u3066\u30c6\u30fc\u30de\u304c\u53cd\u6620\u3057\u3066\u3044\u308c\u3070\u6210\u529f\u3067\u3059\uff01\u304a\u75b2\u308c\u3055\u307e\u3067\u3057\u305f\uff01<\/p>\n<h2 id=\"%E6%9C%80%E5%BE%8C%E3%81%AB\">\u6700\u5f8c\u306b<\/h2>\n<p>\u3082\u3063\u3068\u3053\u3060\u308f\u308a\u305f\u3044\uff01\u3068\u3044\u3046\u65b9\u306fPowerlevel10K\u3068\u3044\u3046\u30c6\u30fc\u30de\u304c\u304a\u3059\u3059\u3081\u3067\u3059\u3002<br \/>\n\u898b\u305f\u76ee\u306e\u5909\u66f4\u3060\u3051\u3067\u306a\u304f\u3001\u69d8\u3005\u306a\u60c5\u5831\u3092\u8868\u793a\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<br \/>\n\u3053\u3053\u3067\u306f\u7d39\u4ecb\u3060\u3051\u3067\u3059\u306e\u3067\u6c17\u306b\u306a\u3063\u305f\u65b9\u306f\u8abf\u3079\u3066\u307f\u3066\u4e0b\u3055\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u958b\u767a\u90e8\u306e\u4e0a\u689d\u3067\u3059\u3002 \u53bb\u5e74\u304f\u3089\u3044\u306emacOS\u300cCatalina\u300d\u304b\u3089\u30c7\u30d5\u30a9\u30eb\u30c8shell\u304czsh\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002 [&hellip;]","protected":false},"author":1,"featured_media":5262,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"vkexunit_cta_each_option":"","footnotes":""},"categories":[6,7,40],"tags":[48,47,49],"class_list":["post-5145","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","category-7","category-40","tag-shell","tag-terminal","tag-zsh"],"acf":[],"jetpack_featured_media_url":"https:\/\/learningbox.co.jp\/wp-content\/uploads\/2020\/10\/2020-10-28_16-10-59.jpg","jetpack_shortlink":"https:\/\/wp.me\/pgMrZ4-1kZ","_links":{"self":[{"href":"https:\/\/learningbox.co.jp\/en\/wp-json\/wp\/v2\/posts\/5145","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/learningbox.co.jp\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/learningbox.co.jp\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/learningbox.co.jp\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/learningbox.co.jp\/en\/wp-json\/wp\/v2\/comments?post=5145"}],"version-history":[{"count":28,"href":"https:\/\/learningbox.co.jp\/en\/wp-json\/wp\/v2\/posts\/5145\/revisions"}],"predecessor-version":[{"id":5180,"href":"https:\/\/learningbox.co.jp\/en\/wp-json\/wp\/v2\/posts\/5145\/revisions\/5180"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/learningbox.co.jp\/en\/wp-json\/wp\/v2\/media\/5262"}],"wp:attachment":[{"href":"https:\/\/learningbox.co.jp\/en\/wp-json\/wp\/v2\/media?parent=5145"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/learningbox.co.jp\/en\/wp-json\/wp\/v2\/categories?post=5145"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/learningbox.co.jp\/en\/wp-json\/wp\/v2\/tags?post=5145"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}