{"id":101621,"date":"2022-08-24T08:50:21","date_gmt":"2022-08-23T23:50:21","guid":{"rendered":"https:\/\/softantenna.com\/blog\/?p=101621"},"modified":"2022-08-24T08:50:21","modified_gmt":"2022-08-23T23:50:21","slug":"mastering-zsh","status":"publish","type":"post","link":"https:\/\/softantenna.com\/blog\/mastering-zsh\/","title":{"rendered":"Mastering Zsh - Zsh\u306e\u4e0a\u7d1a\u30c6\u30af\u30cb\u30c3\u30af\u3092\u89e3\u8aac\u3059\u308b\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8"},"content":{"rendered":"<p><img decoding=\"async\" style=\"display:block; margin-left:auto; margin-right:auto;\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2022\/08\/banner.jpg\" alt=\"Banner\" title=\"banner.jpg\" border=\"0\" width=\"1280\" height=\"640\" \/><\/p>\n<p>Zsh\u306f\u3001Bash\u3092\u521d\u3081\u3068\u3057\u305f\u591a\u304f\u306e\u30b7\u30a7\u30eb\u306e\u6a5f\u80fd\u3092\u53d6\u308a\u8fbc\u3093\u3060\u975e\u5e38\u306b\u591a\u6a5f\u80fd\u306a\u30b7\u30a7\u30eb\u3067\u3059\u3002<\/p>\n<p>\u591a\u304f\u306eLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u3067\u4f7f\u7528\u3067\u304d\u308b\u3060\u3051\u3067\u306f\u306a\u304f\u3001macOS\u3067\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30b7\u30a7\u30eb\u3068\u3057\u3066\u63a1\u7528\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u3082\u3042\u308a\u3001Zsh\u3092\u611b\u7528\u3057\u3066\u3044\u308b\u65b9\u306f\u591a\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u672c\u65e5\u7d39\u4ecb\u3059\u308b\u300c<a href=\"https:\/\/github.com\/rothgar\/mastering-zsh\">Mastering Zsh<\/a>\u300d\u306f\u3001\u3053\u306eZash\u3092\u4f7f\u3044\u3053\u306a\u3059\u306e\u306b\u5f79\u7acb\u3064\u4e0a\u7d1a\u30c6\u30af\u30cb\u30c3\u30af\u3092\u89e3\u8aac\u3059\u308b\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3067\u3059\u3002<\/p>\n<p>\u57fa\u672c\u7684\u306a\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u306e\u4f7f\u3044\u65b9\u306b\u7cbe\u901a\u3057\u3066\u3044\u308b\u30e6\u30fc\u30b6\u30fc\u5411\u3051\u306b\u3001Zsh\u306e\u9ad8\u5ea6\u306a\u4f7f\u3044\u65b9\u3084\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u65b9\u6cd5\u3001\u5b9f\u8df5\u7684\u306a\u4f8b\u3092\u7d39\u4ecb\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>\u5c65\u6b74\u3084\u30d7\u30ed\u30f3\u30d7\u30c8\u306e\u5f37\u5316\u65b9\u6cd5\u304c\u7406\u89e3\u3067\u304d\u308b\uff01<\/h2>\n<p>Mastering Zsh\u306e\u76ee\u6b21\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<p><img decoding=\"async\" style=\"display:block; margin-left:auto; margin-right:auto;\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2022\/08\/s_20220823_203013.jpg\" alt=\"S 20220823 203013\" title=\"s_20220823_203013.jpg\" border=\"0\" width=\"860\" height=\"560\" \/><\/p>\n<p>Zsh\u3092\u4f7f\u3044\u3053\u306a\u3059\u305f\u3081\u306b\u5f79\u7acb\u3064\u60c5\u5831\u304c\u3001\u5927\u304d\u304f\u300c\u8a2d\u5b9a\u300d\u300c\u30d8\u30eb\u30d1\u30fc\u300d\u300c\u4f7f\u7528\u65b9\u6cd5\u300d\u300c\u305d\u306e\u4ed6\u300d\u3068\u3044\u3046\u9805\u76ee\u306b\u308f\u3051\u3089\u308c\u3066\u7d39\u4ecb\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u305d\u306e\u4e2d\u306e\u4f8b\u3048\u3070\u300c\u8a2d\u5b9a\u300d\u3067\u306f\u3001\u300c\u4e00\u822c\u300d\u300c\u5c65\u6b74\u300d\u300c\u30d7\u30ed\u30f3\u30d7\u30c8\u300d\u300chooks\u300d\u3068\u3044\u3063\u305f\u60c5\u5831\u3092\u77e5\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>Zsh\u306e\u4fbf\u5229\u306a\u6a5f\u80fd\u3067\u3042\u308b\u5c65\u6b74\u306b\u95a2\u3057\u3066\u306f\u3001\u4f7f\u3044\u52dd\u624b\u3092\u6539\u5584\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b7\u30a7\u30eb\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u7d39\u4ecb\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre>\r\nsetopt EXTENDED_HISTORY          # Write the history file in the ':start:elapsed;command' format.\r\nsetopt INC_APPEND_HISTORY        # Write to the history file immediately, not when the shell exits.\r\nsetopt SHARE_HISTORY             # Share history between all sessions.\r\nsetopt HIST_EXPIRE_DUPS_FIRST    # Expire a duplicate event first when trimming history.\r\nsetopt HIST_IGNORE_DUPS          # Do not record an event that was just recorded again.\r\nsetopt HIST_IGNORE_ALL_DUPS      # Delete an old recorded event if a new event is a duplicate.\r\nsetopt HIST_FIND_NO_DUPS         # Do not display a previously found event.\r\nsetopt HIST_IGNORE_SPACE         # Do not record an event starting with a space.\r\nsetopt HIST_SAVE_NO_DUPS         # Do not write a duplicate event to the history file.\r\nsetopt HIST_VERIFY               # Do not execute immediately upon history expansion.\r\nsetopt APPEND_HISTORY            # append to history file\r\nsetopt HIST_NO_STORE             # Don't store history commands\r\n<\/pre>\n<p>\u307e\u305f\u30d7\u30ed\u30f3\u30d7\u30c8\u306b\u95a2\u3057\u3066\u306fZsh\u306e\u7279\u5fb4\u3067\u3042\u308b\u300cRPROMPT\u300d(\u53f3\u5074\u306b\u8868\u793a\u3055\u308c\u308b\u30d7\u30ed\u30f3\u30d7\u30c8\u3067\u3059)\u306b\u3001\u6642\u523b\u3084Git\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u60c5\u5831\u3092\u8868\u793a\u3059\u308b\u65b9\u6cd5\u304c\u63b2\u8f09\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre>\r\n# Show time on the right side of the screen\r\n$ export RPROMPT='%t'\r\n\r\n# show git repo info in your prompt\r\nexport RPROMPT='$vcs_info_msg_0_'\r\n<\/pre>\n<p>RPROMPT\u4ee5\u4e0b\u306e\u753b\u50cf\u306e\u3088\u3046\u306b\u30ab\u30ec\u30f3\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u60c5\u5831\u3092\u8868\u793a\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<br \/>\n<img decoding=\"async\" style=\"display:block; margin-left:auto; margin-right:auto;\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2022\/08\/f7efdaceaa345b79e58afadca6b5d737.jpg\" alt=\"\u8cbc\u308a\u4ed8\u3051\u305f\u753b\u50cf 2022 08 23 20 39\" title=\"\u8cbc\u308a\u4ed8\u3051\u305f\u753b\u50cf_2022_08_23_20_39.jpg\" border=\"0\" width=\"860\" height=\"560\" \/><\/p>\n<p>Mastering Zsh\u306b\u306f\u305d\u306e\u4ed6\u306b\u591a\u304f\u306e\u5f79\u306b\u7acb\u3064\u60c5\u5831\u304c\u63b2\u8f09\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>Mastering Zsh\u3092\u8aad\u3080\u3053\u3068\u3067Zsh\u3092\u3055\u3089\u306b\u4f7f\u3044\u3053\u306a\u3059\u305f\u3081\u306e\u60c5\u5831\u3092\u77e5\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<a href=\"https:\/\/github.com\/robbyrussell\/oh-my-zsh\">oh-my-zsh<\/a>\u3084\u3001<a href=\"https:\/\/github.com\/sorin-ionescu\/prezto\">prezto<\/a>\u3092\u5c0e\u5165\u3059\u308b\u306e\u306f\u6c17\u304c\u9032\u307e\u306a\u3044\u3082\u306e\u306e\u3001Zsh\u306e\u3082\u3063\u3068\u4fbf\u5229\u306a\u6a5f\u80fd\u3092\u4f7f\u3044\u305f\u3044\u3068\u601d\u3063\u3066\u3044\u308b\u65b9\u306f\u53c2\u7167\u3057\u3066\u307f\u3066\u306f\u3044\u304b\u304c\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Zsh\u306f\u3001Bash\u3092\u521d\u3081\u3068\u3057\u305f\u591a\u304f\u306e\u30b7\u30a7\u30eb\u306e\u6a5f\u80fd\u3092\u53d6\u308a\u8fbc\u3093\u3060\u975e\u5e38\u306b\u591a\u6a5f\u80fd\u306a\u30b7\u30a7\u30eb\u3067\u3059\u3002 \u591a\u304f\u306eLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u3067\u4f7f\u7528\u3067\u304d\u308b\u3060\u3051\u3067\u306f\u306a\u304f\u3001macOS\u3067\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30b7\u30a7\u30eb\u3068\u3057\u3066\u63a1\u7528\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u3082\u3042\u308a\u3001Zs [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":101624,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[66],"tags":[339],"class_list":["post-101621","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-webservice","tag-zsh"],"_links":{"self":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/101621","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/comments?post=101621"}],"version-history":[{"count":0,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/101621\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media\/101624"}],"wp:attachment":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media?parent=101621"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/categories?post=101621"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/tags?post=101621"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}