msys2 config
August 5, 2020About 1 min
msys2 config
Tips
My solution
lite context
- mkdir /root
- run msys2 , wait for the terminal prompt, close msys2
- run msys2, install packages
pacman -S vim zsh git p7zip rsync winpty - alias vim to vi
ln -s /bin/vim.exe /bin/vi - edit nsswitch.conf, change home_path to /root
- edit nsswitch.conf, change shell to zsh (db_shell: /usr/bin/zsh)
- install on-my-zsh,
sh install.sh - install vimrc
- configure zshrc
- activate poetry
- cp font to folder
pacman_source
configure source (deprecated)
/etc/pacman.d/mirrorlist.mingw32
Server = http://mirrors.ustc.edu.cn/msys2/mingw/i686
/etc/pacman.d/mirrorlist.mingw64
Server = http://mirrors.ustc.edu.cn/msys2/mingw/x86_64
/etc/pacman.d/mirrorlist.msys
Server = http://mirrors.ustc.edu.cn/msys2/msys/$archconfig file link:
configure PATH
mkdir /root
configure nsswitch.conf
change db_home to /root
# Begin /etc/nsswitch.conf
passwd: files db
group: files db
db_enum: cache builtin
db_home: /root
db_shell: /usr/bin/bash
db_gecos: cygwin desc
# End /etc/nsswitch.confInstall packages
pacman -S vim (ln -s /bin/vim.exe /bin/vi)
pacman -S zsh
pacman -S git
pacman -S p7zip
pacman -S rsync
pacman -S winpty
install oh-my-zsh
At first, make sure db_home is /root
with curl
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
or wget
sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
or manual
git clone https://github.com/ohmyzsh/ohmyzsh.git ~/tmp
sh ~/tmp/tools/install.sh
or mine
copy github.com/ohmyzsh/ohmyzsh.git:tools/install.sh to /root/install.sh
sh /root/install.shupdate configure PATH nsswitch.conf
db_shell: /usr/bin/zshInstall VIM
copy .vimrc to ~/.vimrc
copy .vim/autoload to ~/.vim/ (Enable autoload)
若需要打包
升级系统
pacman -Syu
删除所有缓存
pacman -Scc
Plus zshrc
copy .zshrc.win to ~/.zshrc
.zshrc.win
README.md for Msys2
This is a custom version of msys2
HOME PATH is /root
source is mirrors.ustc.edu.cn
manager is pacman
vim is built with vim-plug
Shell is ZSH with on-my-zsh
Font is SourceCodePro-SemiboldInstall SourceCodePro-Semibold.otf at first.
Python & nodejs can be append to .zshrc: