## 参考资料 - [iTerm2 cheatsheet](https://gist.github.com/squarism/ae3613daf5c01a98ba3a) - [Master Mac/Linux Terminal Shortcuts Like a Ninja](https://betterprogramming.pub/master-mac-linux-terminal-shortcuts-like-a-ninja-7a36f32752a6) ## 全局调整 配置弹窗:`Ctrl` + `,` ### 设置margin Advanced > 搜索`margin`:14 ### 隐藏scrollbars Appearance > Hide scrollbars ## default | 默认profile ![](https://user-images.githubusercontent.com/13395840/102502507-09f7cd00-40c2-11eb-9b1e-eda65cafa489.png) ### 配置Esc,Opt键盘 **iTerm2**使用`Esc(Opt)+b/f` 进行移动: - Preferences > Profile > Keys - Left Option: Change 「Normal」→「Esc+」 ### 隐藏标题栏 Profile > window > Style: No Title Bar ### 显示配置状态栏 Profile > Session > Status bar enabled (最下面) ### 设置Window Restoration > 推出后iterm再次打开恢复最后的session Preferences > General > Startup > Use System Window Restoration Setting ### 快捷键配置 moving cursor > Going one word backwards and forwards Preferrence > Profiles > Default > Keyboard Shortcut > `+` - Keyboard Shortcut: `option+→`, `option+←` - Action: `Send Escape Sequence` - Esc: `f`, `b` ## reading | 阅读用profile ![](https://user-images.githubusercontent.com/13395840/102502497-082e0980-40c2-11eb-85a2-d4aeec6ebff9.png) 阅读模式抛弃了标题栏也没有设置状态栏,所以只能用快捷键+鼠标拖动: `Ctrl+OPt+Shift` + Drag ### 添加colorset - download zip from [iterm2colorschemes](https://iterm2colorschemes.com/ ) - Proilfe > Colors > Color Presets: import ~/Download/{folder}/scheme - Select `BlurBerryPie` ### 隐藏标题栏 Profile > window > Style: No Title Bar ### 显示配置状态栏 Profile > Session > Status bar enabled (最下面) ## bash snippets ```bash # colorize man command man() { env \ LESS_TERMCAP_mb="$(printf "\e[1;31m")" \ LESS_TERMCAP_md="$(printf "\e[1;31m")" \ LESS_TERMCAP_me="$(printf "\e[0m")" \ LESS_TERMCAP_se="$(printf "\e[0m")" \ LESS_TERMCAP_so="$(printf "\e[1;44;33m")" \ LESS_TERMCAP_ue="$(printf "\e[0m")" \ LESS_TERMCAP_us="$(printf "\e[1;32m")" \ man "${@}" } function dict() { # curl dict://dict.org/show:db # curl dict://dict.org/d:[word-to-be-searched]:[dictionary-name] curl "dict.org/d:$1" curl "dict.org/d:{$1}:fd-eng-jpn" } function encrypt() { echo "ibase=16; $(echo "$1" |xxd -ps -u)" |bc } function decrypt() { dc -e $1P } function countdown() { echo -e "start [$1s] \n" for n in $(seq $1 1); do echo -ne ".......: $RED$n$NC \r";sleep 1;done;say timer end } function stopwatch() { echo -e "start \n" for n in $(seq 1 216000); do echo -ne ".......: $RED${n}s$NC \r";sleep 1;done;say timer end } ``` ---- - [RANGER IMAGE PREVIEW ON OSX WITH ITERM2](https://www.everythingcli.org/ranger-image-preview-on-osx-with-iterm2/) - [My Writing & Coding Workflow](http://jacobzelko.com/workflow/) お強い、、