Windows 安装 cygwin64

15-08-17 12:03 42668 0 未分类

由于公司给配备了 Windows 7 的开发环境,不得已放弃了 iTerm2,但是 Windows 上实在找不到和 iTerm2 相媲美的命令行工具。 最终选择了 cygwin64,这里讲一下在 cygwin 上安装 oh-my-zsh, tmux 以及 powerline 的方法和步骤。

下载cygwin

https://cygwin.com/setup-x86_64.exe (保存到本地,如:E:\software)

安装时选择 wget, lynx, openssh, zsh, vim, curl, tmux, highlight, gcc, make

创建桌面快捷方式

目标 C:\cygwin64\bin\mintty.exe - 右键->属性->快捷方式->高级->勾选“用管理员身份运行”

安装 oh-my-zsh

sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

如果是cygwin使用zsh,只需要在你的.bashrc里面加上一行 /bin/zsh

添加文件 ~/.tmux.conf

set-option -g default-shell /bin/zsh

tmux source-file ~/.tmux.conf

修改 ~/.bashrc

在文件最后加上

# If not running interactively, do not do anything
[[ $- != *i* ]] && return
[[ -z "$TMUX" ]] && exec tmux

修改 ~/.zshrc

ZSH_THEME="agnoster"
plugins=(git tmux)

在文件最后加上

DEFAULT_USER="$USER"

磁盘映射

ln -s /cygdrive/d /d
ln -s /cygdrive/e /e

安装字体

https://github.com/runsisi/consolas-font-for-powerline/raw/master/Powerline%20Consolas.ttf

新建 .minttyrc

Font=Powerline Consolas
Term=xterm-256color

ForegroundColour=131,148,150
BackgroundColour=0,43,54
CursorColour=220,50,47

Black=7,54,66
BoldBlack=0,43,54
Red=220,50,47
BoldRed=203,75,22
Green=133,153,0
BoldGreen=88,110,117
Yellow=181,137,0
BoldYellow=101,123,131
Blue=38,139,210
BoldBlue=131,148,150
Magenta=211,54,130
BoldMagenta=108,113,196
Cyan=42,161,152
BoldCyan=147,161,161
White=238,232,213
BoldWhite=253,246,227

BoldAsFont=yes
ClipShortcuts=no
RightClickAction=paste
Transparency=off
CursorType=block
Locale=zh_CN
Charset=UTF-8

安装 apt-cyg

lynx -source rawgit.com/transcode-open/apt-cyg/master/apt-cyg > apt-cyg
install apt-cyg /bin

安装 sshpass

git clone git://github.com/kevinburke/sshpass.git
cd sshpass
./configure
make && make install

//sshpass使用
sshpass -p your-password ssh username@hostname
请登录后发表评论 点击登录

文章归档

文章日历

2024 年 04 月
29 01 02 03 04 05 06
07 08 09 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
29 30 01 02 03 04 05

文章标签

最新评论

友情链接