配置Cycript环境前常用工具的安装配置


首先,这些安装工具并非必须的,仅为提升效率使用,以简洁为主

Alfred, 密码:fnsh

pp_mac, 密码:nbva

go2Shell, 密码:v31a

Alfred安装

打开安装包,将Alfred 3拖入程序,打开Alfred 3 KG,点击PATCH弹窗对话框,选择Alfred 3,如果弹出需安装Xcode_select,需要安装,然后点击save,会提示saved successfully,即破解版安装成功

然而,安装成功后打开会提示文件损坏,是因为这并非使用的App Store下载的,需打开系统偏好设设置->安全性与隐私->选择任何来源即可。如果没有任何来源选项,需设置sudo spctl --master-disable

默认使用option+space会唤起Alfred,打开偏好设置,点击Web Search, 可以配置常用app的唤起方式,默认都是一些国外的网站。如果Alfred没有购买或者破解,这个设置是无效的。

可以点击Add Custom Search自己添加一些自定义的搜索设置

只需要在对应的网站上搜索,记下网址,并把具体的搜索内容改为{query}就可以找到我们自定义搜索设置中所需要的Search URL信息了。可以加一些常用的网站设置

另外,Alfred如果需要支持iTerm2需要做额外的设置

添加的脚本内容是

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
on alfred_script(q)  
if application "iTerm2" is running or application "iTerm" is running then
run script "
on run {q}
tell application \":Applications:iTerm.app\"
activate
try
select first window
set onlywindow to false
on error
create window with default profile
select first window
set onlywindow to true
end try
tell current session of the first window
if onlywindow is false then
tell split vertically with default profile
write text q
end tell
end if
end tell
end tell
end run
" with parameters {q}
else
run script "
on run {q}
tell application \":Applications:iTerm.app\"
activate
try
select first window
on error
create window with default profile
select first window
end try
tell the first window
tell current session to write text q
end tell
end tell
end run
" with parameters {q}
end if
end alfred_script
iTerm2安装

下载地址

下载的是压缩文件,解压后是执行程序文件,你可以直接双击,或者直接将它拖到 Applications 目录下

者你可以直接使用 Homebrew 进行安装:

brew cask install iterm2

iTerm2 最常用的主题是 Solarized Dark theme下载地址

下载的是压缩文件,解压一下,然后打开 iTerm2偏好设置界面,然后Profiles -> Colors -> Color Presets -> Import,选择刚才解压的solarized->iterm2-colors-solarized->Solarized Dark.itermcolors文件,导入成功,最后选择Solarized Dark 主题,就可以了

配置 Oh My Zsh

Oh My Zsh 是对主题的进一步扩展,一键安装:

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

安装好之后,需要把 Zsh 设置为当前用户的默认 Shell,这样新建标签的时候才会使用 Zsh,Mac默认使用的是bash

chsh -s /bin/zsh

注意,bash默认加载的文件是.bash_profile,而zsh默认.zshrc,相关配置也是在这两个文件中

这两个都是隐藏文件,Mac上显示隐藏文件的快捷键是shift+commond+. ,不显示隐藏文件再敲一次快捷键即可

然后编辑vim ~/.zshrc,将主题设置为ZSH_THEME="agnoster"

agnoster是比较常用的 zsh 主题之一,你可以挑选你喜欢的主题,zsh 主题列表下载

使用上面的主题,需要 Meslo 字体支持,要不然会出现乱码的情况,字体下载地址

下载好之后,直接在 Mac OS 中安装即可。

然后打开 iTerm2偏好设置,然后Profiles -> Text -> Font -> Chanage Font,选择 Meslo LG M Regular for Powerline 字体

选择什么样的字体和大小可以随意设置

下面设置声明高亮

使用Homebrew安装

brew install zsh-syntax-highlighting

安装成功之后,编辑vim ~/.zshrc文件,在最后一行增加下面配置:

source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

再之后可以添加自动建议填充功能,这个功能比较实用,可以快读的敲出命令

配置步骤,先克隆zsh-autosuggestions项目,到指定目录:

git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions

然后编辑vim ~/.zshrc文件,找到plugins配置,增加zsh-autosuggestions插件。

iTerm还可以额外设置很多很多功能,可自行百度

下面列举一些iTerm2的快捷命令

命令 说明
command + t 新建标签
command + w 关闭标签
command + 数字 command + 左右方向键 切换标签
command + enter 切换全屏
command + f 查找
command + d 垂直分屏
command + shift + d 水平分屏
command + option + 方向键 command + [ 或 command + ] 切换屏幕
command + ; 查看历史命令
command + shift + h 查看剪贴板历史
ctrl + u 清除当前行
ctrl + l 清屏
ctrl + a 到行首
ctrl + e 到行尾
ctrl + f/b 前进后退
ctrl + p 上一条命令
ctrl + r 搜索命令历史

注意,如果使用zsh想完全兼容bash,可以在.zshrc文件最后加上一句source ~/.bash_profile即可

goshell安装

打开安装包,要按住commond再拖动go2shell到finder中去,Mac10.10之后需要按住commond键

安装完打开选择iTerm2

安装goshell可能会遇到一些问题,比如文件夹右上角显示问好之类的,这时候要点击uninstall然后再重新install


如有任何疑问或问题请联系我:fishnewsdream@gmail.com,欢迎交流,共同提高!

Objective-C/Swift技术开发交流群201556264,讨论何种技术并不受限,欢迎各位大牛百家争鸣!

微信公众号OldDriverWeekly,欢迎关注并提出宝贵意见

老司机iOS周报,欢迎关注或订阅

刚刚在线工作室,欢迎关注或提出建设性意见!

刚刚在线论坛, 欢迎踊跃提问或解答!

如有转载,请注明出处,谢谢!

本站总访问量 本文总阅读量