iterm2文档html
终端中输入命令时,移动光标有两种方式,一个是 emacs,一个 vi,能够经过 set 命令来设置,默认的是 emacs 模式,也能够经过set -o emacs来显式设置。若是想使用 vi 模式,可使用以下命令set -o vi开启。
开启vi 模式后,默认是 insert 模式,按下esc键进入命令模式。python
h Move cursor left
l Move cursor right
A Move cursor to end of line and put in insert mode
0 (zero) Move cursor to beginning of line (doesn't put in insert mode)
i Put into insert mode at current position
a Put into insert mode after current position
dd Delete line (saved for pasting)
D Delete text after current cursor position (saved for pasting)
p Paste text that was deleted
j Move up through history commands
k Move down through history commands
u Undo
ctrl + r 搜索历史命令
!! 执行上条命令
ctrl+X Ctrl+E 调用默认编辑器去编辑一个特别长的命令git
oh-my-zsh文档github
$ curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh
powerline文档bash
$ sudo easy_install pip $ pip install powerline-status # 安装字体 $ git clone https://github.com/powerline/fonts.git $ cd到install.sh文件所在目录 $ ./install.sh
安装完字体库以后,把iTerm 2的设置里的Profile中的Text 选项卡中里的Regular Font和Non-ASCII Font的字体都设置成 Powerline的字体curl
agnoster文档编辑器
# 1. 下载 $ git clone https://github.com/fcamblor/oh-my-zsh-agnoster-fcamblor.git # 2. 到下载的工程里面运行install文件,主题将安装到~/.oh-my-zsh/themes目录下
$ 打开 ~/.zshrc # .zshrc文件下面添加ZSH_THEME="agnoster"
Oh My Zsh 自己自带了不少插件,好比说: git, autojump osx, 不过基本都没有启用,插件目录: ~/.oh-my-zsh/plugins字体
参考ui
强大的目录自动跳转命令,会记忆你曾经进入过的目录,用模糊匹配快速进入你想要的目录。url
当你处于一个git受控的目录下时,Shell会明确显示git和branch,另外对git不少命令进行了简化,例如gco=’git checkout’、gd=’git diff’、gst=’git status’、g=’git’等等,熟练使用能够大大减小 git 的命令长度,命令内容能够参考~/.oh-my-zsh/plugins/git/git.plugin.zsh。
功能强大的解压插件,全部类型的文件解压一个命令x全搞定,不再须要去记tar后面究竟是哪几个参数了。
tab加强,quick-look filename能够直接预览文件,man-preview grep能够生成grep手册的pdf版本等。
st # 直接打开sublime st file_a # 用sublime打开文件 file st dir_a # 用sublime打开目录 dir stt # 在sublime打开当前目录,至关于 st .
已经在.oh-my-zsh中包含,若是没有能够按照下面的进行安装
# 安装 $ brew install autojump # 使用 $ j 跳转到最多访问的目录
若是autojump 或者j 使用有问题,请尝试在~/.zshrc(使用默认bash配置文件)中添加[[ -s brew --prefix
/etc/autojump.zsh ]] && . brew --prefix
/etc/autojump.zsh
# ~/.zshrc配置 # 启用插件 git, autojump, osx和autojump plugins=(git osx sudo python autojump)
# 1. 首先下载solarized配色方案 $ git clone git://github.com/altercation/solarized.git # 2. 双击执行solarized/iterm2-colors-solarized/Solarized Dark.itermcolors # (或者Solarized Light.itermcolors ps: 我的觉着dark仍是不错的) # 3. iTerm2 - Preferences - Profiles - colors - load presets 选择刚刚安装的配色主题
iTerm2 - Preferences - Profiles - Text - Text Rendering, 将 Draw bold text in bright colors 前面的勾去掉
Preferences - Keys - Hotkey - Hotkey toggles a dedicated window with profile
把它设置成 Hotkey Window,按快捷键以后 Hotkey Window 会从屏幕上面折叠下来
将其中的 xterm 改为 xterm-256color,好比在 Vim 显示一些配色方案会好不少
open . 在当前目录下打开finder ⌘ + return 全屏 ⌘ + f 所查找的内容会被自动复制 ⌘ + d 横着分屏 / ⌘ + shift + d 竖着分屏令 ⌘ + / 光标位置 ⌘ + r 只是换到新一屏,不会像 clear 同样建立一个空屏 ctrl + u 清除当前行 ctrl + a 到行首 ctrl + e 到行尾 ctrl + w 删除光标以前的单词 ctrl + k 删除到文本末尾 ⌘ + alt + 方向键 切换屏幕(用于hotkey window) ⌘ + 方向键 切换tab ctrl + _ Undo ctrl + y Paste the last thing to be cut