hussein87gabriel

Install MSYS2

Jul 13th, 2022 (edited)
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.92 KB | None | 0 0
  1. 1. Install MSYS2
  2. https://www.msys2.org/
  3. 1.1. Install Windows Terminal from MS Store
  4. 2. Update package
  5. pacman -Syu
  6. 3. Configure in Windows Terminal
  7. Open de json config and add:
  8.  
  9. // This makes MINGW64 the default shell
  10. "defaultProfile": "{17da3cac-b318-431e-8a3e-7fcdefe6d114}",
  11. "profiles": {
  12. "list":
  13. [
  14. // ...
  15. {
  16. "guid": "{17da3cac-b318-431e-8a3e-7fcdefe6d114}",
  17. "name": "MINGW64 / MSYS2",
  18. "commandline": "C:/msys64/msys2_shell.cmd -defterm -here -no-start -mingw64",
  19. "startingDirectory": "C:/msys64/home/%USERNAME%",
  20. "icon": "C:/msys64/mingw64.ico",
  21. "fontFace": "Lucida Console",
  22. "fontSize": 9
  23. },
  24. {
  25. "guid": "{2d51fdc4-a03b-4efe-81bc-722b7f6f3820}",
  26. "name": "MINGW32 / MSYS2",
  27. "commandline": "C:/msys64/msys2_shell.cmd -defterm -here -no-start -mingw32",
  28. "startingDirectory": "C:/msys64/home/%USERNAME%",
  29. "icon": "C:/msys64/mingw32.ico",
  30. "fontFace": "Lucida Console",
  31. "fontSize": 9
  32. },
  33. {
  34. "guid": "{71160544-14d8-4194-af25-d05feeac7233}",
  35. "name": "MSYS / MSYS2",
  36. "commandline": "C:/msys64/msys2_shell.cmd -defterm -here -no-start -msys",
  37. "startingDirectory": "C:/msys64/home/%USERNAME%",
  38. "icon": "C:/msys64/msys2.ico",
  39. "fontFace": "Lucida Console",
  40. "fontSize": 9
  41. },
  42. // ...
  43. ]
  44. }
  45.  
  46. Note in commandline use this:
  47.  
  48. C:/msys64/msys2_shell.cmd -defterm -here -no-start -msys -use-full-path
  49.  
  50. or
  51.  
  52. C:/msys64/usr/bin/env MSYSTEM=MSYS /usr/bin/bash
  53.  
  54. 4. Fix the home directory
  55.  
  56. By default, msys will use /c/msys64/home as your home folder.
  57. If you want to use your existing home folder, set a $HOME env variable under “Environment Variables > User variables”, add HOME -> %USERPROFILE%
  58.  
  59. Then edit /c/msys64/etc/nsswitch.conf to set db_home: /%H.
  60.  
  61. Also, SSH insists on using MSYS’ /home, but you can get around that by adding this line to /etc/fstab:
  62.  
  63. C:/Users /home ntfs binary,noacl,auto 1 1
  64.  
  65. 5. Set Msys2 to inherit your Windows path variable
  66.  
  67. Uncomment, or set, MSYS2_PATH_TYPE=inherit in C:\msys64\msys2.ini.
  68. If you use the mingw32 or mingw64 launchers, set this in their .ini files too.
  69. For this to work, you have to launch the shell from C:\msys64\msys2.exe.
  70.  
  71. 6. Install zsh and nano
  72.  
  73. pacman -S zsh
  74. pacman -S nano
  75.  
  76. 7. Install oh-my-zsh
  77.  
  78. sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
  79.  
  80. 8. Install fonts for theme
  81.  
  82. https://github.com/romkatv/powerlevel10k#meslo-nerd-font-patched-for-powerlevel10k
  83.  
  84. Setup in json.config
  85.  
  86. "font": {
  87. "face": "MesloLGS NF",
  88. "size": 12
  89. }
  90.  
  91. 9. Theme-ing Oh-My-Zsh
  92.  
  93. git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
  94.  
  95. Then, type nano ~/.zshrc. This opens nano, a text editor. Edit the line where it says, ZSH_THEME="robbyrussell" to ZSH_THEME="powerlevel10k/powerlevel10k".
  96. Restart terminal
  97.  
  98. If wizard dont start, use the next commmand:
  99. p10k configure
  100.  
  101. 10. Oh-my-zsh plugins
  102.  
  103. Note that I’ve added two extra plugins (look for the plugins=... line), zsh-autosuggestions and zsh-autocomplete. You can copy this and paste this to nano editor while editing ~/.zshrc .
  104. But you do need to install them. To do that, run:
  105.  
  106. git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
  107. git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
  108.  
  109. 11. Start zsh at begining
  110.  
  111. Open the json.config from Windows Terminal
  112.  
  113. "commandline": "C:/msys64/usr/bin/zsh.exe",
  114.  
  115. 12. Transparency for terminal
  116.  
  117. "defaults":
  118. {
  119. "acrylicOpacity": 0.5,
  120. "useAcrylic": true
  121. },
  122.  
  123. 13. Open Environment system variables, edit Path and add the next two:
  124. - C:\msys64\mingw64\bin
  125. - C:\msys64\usr\bin
Add Comment
Please, Sign In to add comment