{"id":181939,"date":"2020-05-16T07:55:03","date_gmt":"2020-05-15T23:55:03","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=181939"},"modified":"2020-05-15T21:09:32","modified_gmt":"2020-05-15T13:09:32","slug":"zsh-oh-my-zsh","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/zsh-oh-my-zsh.html","title":{"rendered":"\u7b14\u8bb0\uff1azsh\u548coh-my-zsh"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u547d\u4ee4\u884c\u662f\u7a0b\u5e8f\u5458\u7684\u6700\u7231\uff0c\u9ed8\u8ba4\u7684bash shell<\/code>\u867d\u7136\u529f\u80fd\u5df2\u7ecf\u5f88\u5f3a\u5927\uff0c\u4f46\u663e\u5f97\u592a\u6734\u7d20\u4e86\uff0c\u4e5f\u4e0d\u591f\u667a\u80fd\uff0c\u8fdc\u8fdc\u8c08\u4e0d\u4e0a\u9177\u70ab\uff0c\u867d\u7136\u5df2\u7ecf\u8fdc\u8fdc\u5c06 windows \u7684 cmd \u7529\u5f00\u51e0\u767e\u6761\u8857\u3002\u4f46\u5bf9\u4e8e\u6781\u5ba2\u6765\u8bf4\uff0cbash<\/code>\u8fd8\u662f\u592a\u5f31\u4e86\uff0c\u957f\u5f97\u4e5f\u96be\u770b\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

zsh<\/code>\u00a0\u7684\u529f\u80fd\u6bd4bash<\/code>\u5f3a\u5927\u5f88\u591a\uff0c\u4f46\u914d\u7f6e\u8fc7\u4e8e\u590d\u6742\uff0c\u8d77\u521d\u53ea\u6709\u6781\u5ba2\u624d\u5728\u7528\u3002\u540e\u6765\uff0c\u6709\u4e2a\u7a77\u6781\u65e0\u804a\u7684\u7a0b\u5e8f\u5458\u53ef\u80fd\u662f\u5b9e\u5728\u770b\u4e0d\u4e0b\u53bb\u5e7f\u5927\u733f\u53cb\u4e00\u76f4\u53ea\u80fd\u4f7f\u7528\u5355\u8c03\u7684bash<\/code>\uff0c \u4e8e\u662f\u4ed6\u521b\u5efa\u4e86\u4e00\u4e2a\u540d\u4e3a\u00a0oh-my-zsh<\/code>\u00a0\u7684\u5f00\u6e90\u9879\u76ee...<\/p>\n

\u81ea\u6b64\uff0c\u53ea\u9700\u8981\u7b80\u5355\u7684\u5b89\u88c5\u914d\u7f6e\uff0c\u5c0f\u767d\u7a0b\u5e8f\u5458\u4eec\u90fd\u53ef\u4ee5\u7528\u4e0a\u9ad8\u6863\u5927\u6c14\u4e0a\u6863\u6b21\uff0c\u72c2\u62fd\u70ab\u9177\u540a\u70b8\u5929\u7684\u00a0oh-my-zsh<\/a><\/p>\n

\"\"<\/p>\n

\u5b89\u88c5zsh<\/strong><\/div>\n

\u4ee5centos7\u4e3a\u4f8b\uff1a(mac\u4e5f\u662f\u7c7b\u4f3c\u7684\u64cd\u4f5c)<\/p>\n

\u67e5\u770b\u7cfb\u7edf\u662f\u5426\u5b89\u88c5\u4e86zsh\uff0c\u5982\u679c\u6ca1\u627e\u5230\/bin\/zsh<\/code>\uff0c\u5c31\u9700\u8981\u5148\u5b89\u88c5<\/p>\n

cat \/etc\/shells\r\n\/bin\/sh\r\n\/bin\/bash\r\n\/sbin\/nologin\r\n\/usr\/bin\/sh\r\n\/usr\/bin\/bash\r\n\/usr\/sbin\/nologin\r\n\/bin\/tcsh\r\n\/bin\/csh<\/pre>\n

centos7\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u6ca1\u5b89\u88c5zsh<\/p><\/blockquote>\n

\u7528\u00a0yum<\/code>\u00a0\u5b89\u88c5\u00a0zsh<\/code><\/p>\n

$ sudo yum -y install zsh<\/pre>\n

\u5b89\u88c5\u6210\u529f<\/p>\n

$ cat \/etc\/shells | grep zsh\r\n\/bin\/zsh<\/pre>\n

\u5207\u6362shell\u4e3azsh<\/code><\/p>\n

$ chsh -s \/bin\/zsh\r\nChanging shell for root.\r\nShell changed.<\/pre>\n

\u9000\u51fa\uff0c\u91cd\u542f\u7ec8\u7aef\uff0c\u53ef\u770b\u5230shell\u5df2\u5207\u6362\u6210\u529f<\/p>\n

$ echo $SHELL\r\n\/bin\/zsh<\/pre>\n
\u5b89\u88c5oh-my-zsh<\/strong><\/div>\n

\u4e00\u884c\u547d\u4ee4\u5373\u53ef\u81ea\u52a8\u5316\u5b89\u88c5<\/p>\n

$ wget https:\/\/github.com\/robbyrussell\/oh-my-zsh\/raw\/master\/tools\/install.sh -O - | sh<\/pre>\n

\u6210\u529f\u754c\u9762\uff1a<\/p>\n

\"\"<\/p>\n

\u9000\u51fa\u91cd\u65b0\u767b\u5165\u7ec8\u7aef\uff0c\u5373\u53ef\u770b\u5230oh-my-zsh\u5df2\u7ecf\u751f\u6548<\/p>\n

\u63a5\u4e0b\u6765\u53ea\u9700\u7b80\u5355\u7684\u914d\u7f6e\uff0c\u5c31\u53ef\u4ee5\u4eab\u53d7\u00a0oh-my-zsh<\/code>\u00a0\u7684\u5f3a\u5927<\/p>\n

\u4e3b\u9898\u9009\u62e9<\/strong><\/div>\n

oh-my-zsh\u6709\u5f88\u591a\u6f02\u4eae\u7684\u4e3b\u9898\uff1a<\/p>\n

\u5728\u4e3b\u9898\u5217\u8868<\/a>\u4e2d\u9009\u62e9\u81ea\u5df1\u5fc3\u5b9c\u7684\u4e3b\u9898\uff0c\u5b89\u88c5\u5f88\u7b80\u5355\uff0c\u6253\u5f00\u914d\u7f6e\u6587\u4ef6\u00a0~\/.zhsrc<\/code>\u00a0\uff0c\u5c06\u00a0ZSH_THEME<\/code>\u00a0\u503c\u6539\u4e3a\u4f60\u6240\u9009\u7684\u4e3b\u9898\u540d\u79f0<\/p>\n

\u5982\uff1a<\/p>\n

$ vim ~\/.zshrc\r\n# \u4fee\u6539\u4e3b\u9898\u540d\u79f0\r\nZSH_THEME=\"ys\"<\/pre>\n

\u7136\u540e\u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e\u6587\u4ef6<\/p>\n

$ source ~\/.zshrc<\/pre>\n

\u6bcf\u6b21\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u540e\uff0c\u90fd\u9700\u8981\u518d\u6b21\u52a0\u8f7d\u914d\u7f6e\u6587\u4ef6\u624d\u80fd\u751f\u6548<\/p><\/blockquote>\n

\u63d2\u4ef6<\/strong><\/div>\n

oh-my-zsh\u9ed8\u8ba4\u5b89\u88c5\u4e86git\u63d2\u4ef6\uff0c\u5728git\u4ed3\u5e93\u4e2d\uff0c\u4f1a\u63d0\u793a\u5f53\u524d\u6240\u5728\u7684\u5206\u652f\u3002\u6b64\u5916\uff0c\u8fd8\u6709\u5927\u91cf\u4f18\u79c0\u7684\u63d2\u4ef6\uff0c\u5177\u4f53\u53ef\u67e5\u770b\u63d2\u4ef6\u4ed3\u5e93<\/a>\uff0c\u4ee5\u4e0b\u53ea\u4ecb\u7ecd\u51e0\u4e2a\u6211\u5e38\u7528\u7684\u63d2\u4ef6<\/p>\n