相关文件夹:
-
Package cache: d:\warez\cygwinPackages
-
Installation directory: d:\apps\cygRoot
-
User home directory: d:\docs\cygHome
安装步骤:
-
从cygwin官网下载setup-x86_64.exe
-
安装cygwin核心:在Windows命令行中执行
setup-x86_64.exe --no-admin -q -n -R d:\apps\cygRoot -s http://mirrors.163.com/cygwin/ -l d:\warez\cygwinPackages -
修改
$Home目录:在 D:\apps\cygRoot\etc\nsswitch.conf 文件中增加db_home: /cygdrive/d/docs/cygHome; -
定义启动快捷键
Alt-F10:在Autohotkey脚本中添加!F10:: Run D:\apps\cygRoot\bin\mintty.exe -i /Cygwin-Terminal.ico - -
修改用户名:启动cygwin,执行命令
mkpasswd -c > /etc/passwd -
安装新包:在Windows命令行中执行
setup-x86_64.exe --no-admin -q -n -R d:\apps\cygRoot -s http://mirrors.163.com/cygwin/ -l d:\warez\cygwinPackages -P tmux,python3,vim,zsh,fzf-zsh,git,curl,zip,unzip,python3-setuptools,the_silver_searcher,procps-ng -
安装
pip:cygwin中执行easy_install-x.y pip,例如easy_install-3.4 pip -
安装oh-my-zsh:
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh -
安装autojump:
git clone git://github.com/joelthelion/autojump.git cd autojump ./install.py echo '[[ -s /cygdrive/d/docs/cygHome/.autojump/etc/profile.d/autojump.sh ]] && source /cygdrive/d/docs/cygHome/.autojump/etc/profile.d/autojump.sh' >> ~/.zshrc -
安装Vundle:
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim` vim +PluginInstall -
使用
vi启动vim:在~/.bash_aliases中增加alias vi='vim' -
恢复配置和笔记
mkdir $HOME/apps cd $HOME/apps git clone git@github.com:leetschau/sysClone.git git clone git@github.com:leetschau/dsnote.git // download dsnote tarball dn r -
使用
zsh作为登录shell:将/etc/passwd中的登录shell改为/bin/zsh
说明:
-
不要安装到C盘,不要使用管理员权限安装:
setup-x86_64.exe --no-admin -
cygwin使用
Alt-F11作为全屏快捷键,所以这里将启动快捷键改为Alt-F10 -
使用
cygcheck -p <package-name>来搜索package,类似于apt search ... -
cygwin中可以直接使用Windows中的环境变量,大小写必须与Windows中的定义一致, 在Windows命令行中用
set命令列出所有环境变量,在cygwin下用env列出所有环境变量
Uninstall cygwin
- Uninstall services:
cygrunsrv -L - Delete cygwin root folders:
d:\apps\cygRoot
待解决问题
- fzf无法用
Ctrl-R搜索命令历史:在 sysClone/confs 中增加文件~/.fzf.zsh