{"id":144,"date":"2021-11-27T00:12:06","date_gmt":"2021-11-26T16:12:06","guid":{"rendered":"https:\/\/www.osvlabs.com\/blog\/?p=144"},"modified":"2021-11-27T00:12:06","modified_gmt":"2021-11-26T16:12:06","slug":"mac-linux-%e7%bb%88%e7%ab%af%e7%be%8e%e5%8c%96-oh-my-zsh","status":"publish","type":"post","link":"https:\/\/blog.osvlabs.com\/?p=144","title":{"rendered":"[Mac\/Linux] \u7ec8\u7aef\u7f8e\u5316 + Oh My Zsh"},"content":{"rendered":"<p>\u6574\u5bb9\u524d\uff1a<img src=\"https:\/\/raw.githubusercontent.com\/Attiv\/tubed\/master\/CleanShot%202021-11-26%20at%2020.21.10%402x.png\" alt=\"\u6574\u5bb9\u524d\" \/><\/p>\n<p>\u6574\u5bb9\u540e\uff1a<img src=\"https:\/\/raw.githubusercontent.com\/Attiv\/tubed\/master\/CleanShot%202021-11-26%20at%2023.38.15%402x.png\" alt=\"\" \/><\/p>\n<blockquote>\n<p>\u672c\u7bc7\u4ee5 Linux \u670d\u52a1\u5668\u4e3a\u4f8b<\/p>\n<\/blockquote>\n<ol>\n<li>\u5b89\u88c5 <a href=\"https:\/\/ohmyz.sh\">Oh My Zsh<\/a><br \/>\n1) \u6267\u884c: <code>sh -c &quot;$(curl -fsSL https:\/\/raw.github.com\/ohmyzsh\/ohmyzsh\/master\/tools\/install.sh)&quot;<\/code><br \/>\n2) \u5b89\u88c5\u5b8c\u4e4b\u540e\u662f\u8fd9\u6837<img src=\"https:\/\/raw.githubusercontent.com\/Attiv\/tubed\/master\/CleanShot%202021-11-26%20at%2020.22.19%402x.png\" alt=\"\u5b89\u88c5\u540e\" \/><\/li>\n<\/ol>\n<blockquote>\n<p>\u5b89\u88c5\u63d2\u4ef6\u7684\u65b9\u5f0f\u6709\u5f88\u591a\uff0c\u8fd9\u91cc\u4f7f\u7528\u4e86Zplug<\/p>\n<\/blockquote>\n<ol start=\"2\">\n<li>\n<p>\u5b89\u88c5<a href=\"https:\/\/github.com\/zplug\/zplug\">ZPlug<\/a><\/p>\n<p>1) \u6267\u884c <code>curl -sL --proto-redir -all,https https:\/\/raw.githubusercontent.com\/zplug\/installer\/master\/installer.zsh | zsh<\/code><\/p>\n<p>2) \u5b89\u88c5\u5b8c\u4e4b\u540e\u7f16\u8f91 <code>.zshrc<\/code> \u6587\u4ef6. <code>vi ~\/.zshrc<\/code><br \/>\n\u9996\u5148\u5bfc\u5165<code>zplug<\/code>: <code>source ~\/.zplug\/init.zsh<\/code><\/p>\n<blockquote>\n<p>\u4e3b\u9898\u6709\u5f88\u591a\uff0c\u8fd9\u91cc\u6211\u4eec\u4f7f\u7528<a href=\"https:\/\/github.com\/romkatv\/powerlevel10k#zplugin\">P10K<\/a><br \/>\n<code>p10k<\/code> \u8981\u6c42 <code>zsh<\/code> \u6700\u4f4e\u7248\u672c 5.1, \u5177\u4f53\u529e\u6cd5\u81ea\u5df1\u641c,<strong>\u9700\u8981\u6ce8\u610f\u5378\u8f7d\u8001\u7248\u672c\u7684zsh\u4e4b\u540e\u5b89\u88c5\u65b0\u7684\u4e4b\u524d\u53ef\u80fd\u4f1a\u5bfc\u81f4\u5bc6\u7801\u767b\u5f55\u670d\u52a1\u5668\u62a5\u9519<\/strong><\/p>\n<\/blockquote>\n<p>\u5728<code>zshrc<\/code>\u6587\u4ef6\u91cc\u52a0\u5165:<\/p>\n<pre><code> zplug romkatv\/powerlevel10k, as:theme, depth:1<\/code><\/pre>\n<p>\u7136\u540e <code>source .zshrc<\/code>\uff0c\u4f1a\u63d0\u793a\u5b89\u88c5\u63d2\u4ef6\uff0c\u5982\u679c\u6ca1\u6709\u53ef\u4ee5\u624b\u52a8\u6267\u884c<code>zplug install<\/code><br \/>\n\u7136\u540e\u6839\u636e\u7ec8\u7aef\u63d0\u793a\u914d\u7f6ep10k.<br \/>\n<img src=\"https:\/\/raw.githubusercontent.com\/Attiv\/tubed\/master\/CleanShot%202021-11-26%20at%2023.32.58%402x.png\" alt=\"\u770b\u8fd9\" \/><\/p>\n<p>\u914d\u7f6e\u5b8c\u5c31\u53ef\u4ee5\u4e86<\/p>\n<\/li>\n<li>\n<p>Mac \u7aef\u5b89\u88c5\u65b9\u6cd5\u7c7b\u4f3c\uff0c\u66f4\u7b80\u5355, Mac \u63a8\u8350\u4f7f\u7528 <a href=\"https:\/\/iterm2.com\/\">Iterm2<\/a>\u4ee3\u66ff\u7ec8\u7aef<br \/>\n\u4ee4\u5206\u4eab\u4e00\u4e9b\u63d2\u4ef6\uff1a<\/p>\n<pre><code>\nzplug 'zplug\/zplug', hook-build:'zplug --self-manage'\n# git git\u547d\u4ee4alias, \u4f7f\u7528 cat ~\/.oh-my-zsh\/plugins\/git\/git.plugin.zsh \u67e5\u770b\u6240\u6709\nzplug \"plugins\/git\",   from:oh-my-zsh\nzplug \"plugins\/osx\",   from:oh-my-zsh\n# vscode \u4f7f\u7528vscode \u6253\u5f00\u6587\u4ef6\nzplug \"plugins\/vscode\",   from:oh-my-zsh\n# Z \u7c7b\u4f3c autojump,\u5feb\u901f\u8df3\u8f6c\u6587\u4ef6\u5939\nzplug \"plugins\/z\",   from:oh-my-zsh \n# d \u8df3\u8f6c\u5f53\u524d\u7ec8\u7aef\u66fe\u7ecfcd \u8fc7\u7684\u76ee\u5f55\nzplug \"plugins\/d\",   from:oh-my-zsh\n# extract \u89e3\u538b\nzplug \"plugins\/extract\",   from:oh-my-zsh\n# zplug \"plugins\/git-open\",   from:oh-my-zsh\n# git-open \u5728\u6d4f\u89c8\u5668\u91cc\u6253\u5f00\u5f53\u524dgit\u4ed3\u5e93\nzplug \"paulirish\/git-open\", as:plugin\n# sudo \u6309\u4e24\u4e0bESC\uff0c\u5c31\u4f1a\u5728\u547d\u4ee4\u884c\u5934\u90e8\u52a0\u4e0asudo\nzplug \"plugins\/sudo\",   from:oh-my-zsh\n# cp \u590d\u5236\u663e\u793a\u8fdb\u5ea6\u6761\nzplug \"plugins\/cp\",   from:oh-my-zsh\n# web-search \u6dfb\u52a0\u547d\u4ee4\u4ee5\u76f4\u63a5\u4ece CLI \u8fd0\u884c bing\u3001google\u3001yahoo \u548c duckduckgo \u641c\u7d22.\nzplug \"plugins\/web-search\",   from:oh-my-zsh\n# rand-quote \u6ca1\u5565\u7528,\u968f\u673a\u663e\u793a\u540d\u8a00\nzplug \"plugins\/rand-quote\", from:oh-my-zsh\n# zplug \"plugins\/history-substring-search\",  from:oh-my-zsh\n# command-not-found \u5f53\u4f60\u8f93\u5165\u4e00\u6761\u4e0d\u5b58\u5728\u7684\u547d\u4ee4\u65f6\uff0c\u4f1a\u81ea\u52a8\u67e5\u8be2\u8fd9\u6761\u547d\u4ee4\u53ef\u4ee5\u5982\u4f55\u83b7\u5f97\u3002\nzplug \"plugins\/command-not-found\",   from:oh-my-zsh\n# zsh-syntax-highlighting \u547d\u4ee4\u9ad8\u4eae \u7ea2\u8272\u4ee3\u8868\u6ca1\u6709\u6b64\u547d\u4ee4 \u7eff\u8272\u53ef\u80fd\u6267\u884c\u6b64\u547d\u4ee4\nzplug \"zsh-users\/zsh-syntax-highlighting\"\n# autosuggestions \u8865\u5168\u547d\u4ee4\u5386\u53f2\nzplug \"zsh-users\/zsh-autosuggestions\"\n# gitignore \u63d0\u4f9b\u4e00\u6761 gi \u547d\u4ee4\uff0c\u7528\u6765\u67e5\u8be2 gitignore \u6a21\u677f\u3002\u6bd4\u5982\u4f60\u65b0\u5efa\u4e86\u4e00\u4e2a python \u9879\u76ee\uff0c\u5c31\u53ef\u4ee5\u7528\uff1agi python > .gitignore \nzplug \"voronkovich\/gitignore.plugin.zsh\"\n# zsh-history-substring-search \u67e5\u627e\u5339\u914d\u524d\u7f00\u7684\u5386\u53f2\u8f93\u5165,\u4f7f\u7528\u65b9\u5f0f\u641c\u4e00\u4e0b\u5427\nzplug \"zsh-users\/zsh-history-substring-search\"<\/code><\/pre>\n<\/li>\n<\/ol>\n<pre><code><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6574\u5bb9\u524d\uff1a \u6574\u5bb9\u540e\uff1a \u672c\u7bc7\u4ee5 Linux \u670d\u52a1\u5668\u4e3a\u4f8b \u5b89\u88c5 Oh My Zsh 1) \u6267\u884c: sh -c &quot;$(curl -fsSL https:\/\/raw.github.com\/ohmyzs\u2026<\/p>\n","protected":false},"author":4,"featured_media":145,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":5}},"_links":{"self":[{"href":"https:\/\/blog.osvlabs.com\/index.php?rest_route=\/wp\/v2\/posts\/144"}],"collection":[{"href":"https:\/\/blog.osvlabs.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.osvlabs.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.osvlabs.com\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.osvlabs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=144"}],"version-history":[{"count":1,"href":"https:\/\/blog.osvlabs.com\/index.php?rest_route=\/wp\/v2\/posts\/144\/revisions"}],"predecessor-version":[{"id":146,"href":"https:\/\/blog.osvlabs.com\/index.php?rest_route=\/wp\/v2\/posts\/144\/revisions\/146"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.osvlabs.com\/index.php?rest_route=\/wp\/v2\/media\/145"}],"wp:attachment":[{"href":"https:\/\/blog.osvlabs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=144"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.osvlabs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=144"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.osvlabs.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=144"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}