linux on win7

Cygwin、Msys、MinGW、Msys2的区别与联系

近期在一台thinkpad上折腾win7, 起初是想用emacs, 发现需要一些linux上的工具链,结果发各种linux相关的环境Cygwin/Msys/MinGW/Msys2…

  1. How-does-MSYS2-differ-from-Cygwin
  2. msys2 = cygwin1.dll + pacman
  3. cygwin = cygwin1.dll + setup.exe
  4. mingw不依赖cygwin1.dll, 是原生方式实现了少量重要的GNU工具
  5. msys2 = cygwin1.dll + pacman + mingw64/clang/ucart

diff table

software pros&cons
Cygwin win上大而全的linux模拟器
编译出的软件在win上需要依靠虚拟层才能正常运行
MinGW 提供工具链,编译出来的软件是
windows native的
仅提供工具,缺少可用系统和包管理工具
Msys2 可提供最小可用的system
并有包管理工具pacman
Ref: Cygwin、Msys、MinGW、Msys2的区别与联系(转)

emacs_on_win

1. General config

1.1 Create a HOME system environment variable.

  1. set HOME variable c:/Users/username
    read the prepare steps first before installation
  2. set symbolic link to * repository
    mklink /D .emacs.d d:*\emacs.d

1.2 download & install msys2

(the last version can run on win7)
https://repo.msys2.org/distrib/x86_64/
msys2-x86_64-20221028.exe
(you can install it in d:msys64)

1.3 update msys2

execute multiple times until the last status

1
pacman -Syu

1.4 install emacs

1
2
pacman -S emacs
pacman -S mingw-w64-x86_64-emacs

1.5 run emacs

tui
run emacs from Msys2-msys2
gui
run emacs from D:\*\msys64\mingw64\bin\emacs-28.2.exe
run emacs from Msys2-MinGW

1.6 install plugins

switch between emacs(cli) & emacs(gui) several times to run and install packages as many as possible
when stuck on some init-file config like (scroll-bar-mode -1),you can just comment it. it’s OK to do so, because we want to install asmany package, and the final aim is to use pdf-tools & org-noter

2. config pdf-tool& org-noter

2.1 install pdf-tool

run pdf-tool-install from emacs(gui)

2.2 eval pdf-tool & org-noter lisp code

open init-org from D:*\emacs.d\lisp\init-org.el

  1. eval key-binding & use-package related lisp code
  2. eval (require 'org-noter_modifer) to allow use custom org-noter function
  3. config linum-mode
    before open an pdf, you have to turn linum-mode off. This could be done by adding a pdf-view-mode-hook hook, or you’ll stuck when try open pdf file.

2.3 open pdf & org-noter

D:\*\*.org
M-x execute org-noer

2.4 enjoy with pain