Mac 终端 oh-my-zsh 配置

 

Mac 终端默认 shell 为 bash。
zsh 可能是目前最好的 shell ,至于好在哪里可自行百度。
本文主要介绍使用 zsh 以及 oh-my-zsh 的配置。

使用 zsh

查看当前使用的 shell

echo $SHELL

/bin/bash

查看安装的 shell

cat /etc/shells

/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh

使用 brew 更新 zsh

brew install zsh

==> Downloading https://homebrew.bintray.com/bottles/zsh-5.5.1.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring zsh-5.5.1.high_sierra.bottle.tar.gz
/usr/local/Cellar/zsh/5.5.1: 1,444 files, 12MB

切换为 zsh

chsh -s /bin/zsh

重启终端即可使用 zsh

oh-my-zsh

安装

执行从 oh-my-zsh 的 GitHub 下载的安装脚本

sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

  ____  / /_     ____ ___  __  __   ____  _____/ /_
/ __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \
/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / /
\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/
/____/ ....is now installed! Please look over the ~/.zshrc file to select plugins, themes, and options. p.s. Follow us at https://twitter.com/ohmyzsh. p.p.s. Get stickers and t-shirts at http://shop.planetargon.com.

主题

打开 oh-my-zsh 配置文件

vim ~/.zshrc
 

配置项 ZSH_THEME 即为 oh-my-zsh 的主题配置,oh-my-zsh 的 GitHub Wiki 页面提供了 主题列表
当设置为 ZSH_THEME=random 时,每次打开终端都会使用一种随机的主题。

更新配置

source ~/.zshrc

自动补全插件

下载 incr 自动补全插件 http://mimosa-pudica.net/src/incr-0.2.zsh
将插件放在 oh-my-zsh 自定义插件目录中

 

打开 oh-my-zsh 配置文件

vim ~/.zshrc
 

在 plugins 中添加 incr
在配置文件结束添加:

source $ZSH/custom/plugins/incr/incr*.zsh

更新配置

source ~/.zshrc

最终效果如官网所示:

 

Homebrew:
https://brew.sh/index_zh-cn
https://github.com/Homebrew/brew
oh-my-zsh:
https://ohmyz.sh/
https://github.com/robbyrussell/oh-my-zsh
incr:
http://mimosa-pudica.net/zsh-incremental.html

mac添加oh my zsh的更多相关文章

  1. 转载:(Mac)在bash和zsh配置环境变量path的几种方法

    参考文献 老习惯,列出本文参考或引用或转载的文档和博客,致以崇高的敬意,感兴趣的可以去看看 1.http://postgresapp.com/ 2.http://postgresapp.com/doc ...

  2. iOS mac添加证书 不能修改“System Roots”钥匙串错误

    iOS mac添加证书 不能修改“System Roots”钥匙串错误 如图: 解决方式: 打开钥匙串---登录---,直接把证书拖过来 然后,查看--我的证书,里面,找到证书,即可

  3. Mac 小记 — iTerm2、Zsh、Homebrew

    前言 写完 "Ubuntu 自动化配置" 这篇文章后,每次连服务器心情指数都上升好几个百分点,于是想着应该将 macOs 的开发环境也梳理梳理,应该会对开发效率有所增益. 1. i ...

  4. mac 添加安卓设备的支持

    1. 把android设备插到mac电脑上 2. 首先可以看一下之前在该mac电脑上有没有添加过这个 , 命令 : adb devices      如果显示出,下面字样,说明之前添加过了,下面就可以 ...

  5. 【转】Mac OS X 中 Zsh 下 PATH 环境变量的正确设置

    在 Mac OS X 中使用 zsh,环境变量 PATH 一不小心就会变得很紊乱,表现为自己设置的路径总是被放到系统路径之后,部分路径还会有重复.这是我们不太了解 zsh 启动时加载文件的顺序和 Ma ...

  6. mac 添加环境变量(jmeter添加至环境变量中)

    Mac系统的环境变量,加载顺序为:a. /etc/profileb. /etc/pathsc. ~/.bash_profiled. ~/.bash_logine. ~/.profilef. ~/.ba ...

  7. Mac添加命令别名

    1. 切换到用户主目录 $ cd 2. 编辑或新建.bash_profile文件 3. 添加别名 命令别名设置语法: alias [别名]='[指令名称]' 注意:等号两边均无空格,指令名称中如有空格 ...

  8. mac 添加环境变量

    1.Mac系统的环境变量,加载顺序为: a. /etc/profile b. /etc/paths c. ~/.bash_profile d. ~/.bash_login e. ~/.profile ...

  9. Mac OSX:安装zsh

    想在mac下安装oh my zsh,按照https://github.com/robbyrussell/oh-my-zsh上的文档,执行下面这条命令安装:curl -L http://install. ...

随机推荐

  1. js写入和读取cookie

    <!doctype html> <html> <head> <meta http-equiv="Content-Type" content ...

  2. windows系统下同时安装mysql5.5和8.0.11

    前提:电脑已安装5.5,增安装8.0.11 zip版本 1.官网下载mysql10.8.0.11 —找到mysql community server 为下载页面URL:https://dev.mysq ...

  3. 当代码上传git时,提示Repository not found The requested repository does not exist, or you do not have permission to access it. fatal: Could not read from remote repository. Please make sure you have the corre

    1.检查当前git中设置的用户名与邮箱是否与自己电脑上的一致. 看这个文件中 如果不一致,只需要把里面的内容全部复制出来添加到git(看下图位置) 这是再执行:git push -u origin m ...

  4. 多线程、线程池、线程创建、Thread

    转载自https://www.cnblogs.com/jmsjh/p/7762034.html 多线程 1.1 多线程介绍 学习多线程之前,我们先要了解几个关于多线程有关的概念. 进程:进程指正在运行 ...

  5. shell request failed on channel 0

    今天普通用户ssh 登录提示shell request failed on channel 0 然后就退出了 幸亏root 用户没有被禁用,在root下 su - 普通 切换提示资源不足 解决方法  ...

  6. 阿里云k8s构建镜像时设置版本号用于版本回滚

    jenkins 构建配置参数化构建过程 构建  执行 shell  , 将版本号参数传入 脚本 脚本push  带版本号的镜像到阿里云镜像仓库 #!/bin/bash #获取参数 while geto ...

  7. 算法练习之合并两个有序链表, 删除排序数组中的重复项,移除元素,实现strStr(),搜索插入位置,无重复字符的最长子串

    最近在学习java,但是对于数据操作那部分还是不熟悉 因此决定找几个简单的算法写,用php和java分别实现 1.合并两个有序链表 将两个有序链表合并为一个新的有序链表并返回.新链表是通过拼接给定的两 ...

  8. [07]Go设计模式:过滤器模式(FilterPattern)

    目录 过滤器模式 一.简介 二.代码 三.参考链接 过滤器模式 一.简介 过滤器模式(Filter Pattern)或标准模式(Criteria Pattern)是一种设计模式,这种模式允许开发人员使 ...

  9. seaborn做横向条形图

    数据格式如下 这里选择fold值最大的前20个作图进行展示 代码如下 import seaborn as sns import pandas as pd import numpy as np impo ...

  10. Windows 下升级 node & npm 到最新版本

    查询 Node 的安装目录where node 升级 Node:在官网下载最新的安装包,直接安装即可.https://nodejs.org/ 升级 npmnpm install -g npm 使用 n ...