surviving M$ Windows

click for background Long ago, I was paid to sort a Windows XP subsystem.
Even longer ago, I brought to graduate school an IBM XT (hard drive upgraded to 20MB)
with both mono and color displays, PC-DOS, IBM PC APL, Turbo Pascal and DeSmet C
Grad school led to Unix (eventually HP/UX, AIX, IRIX, SunOS, slackware, red hat, fedora)
with a few Macs for e.g. PhotoShop and eventually iOS development.
As a part time system administrator, shell usage was unavoidable,
and xterm with bash and vim became my weapons of choice.

Windows was mostly for new or obscure hardware unsupported elsewhere
and recovering family and friends' PCs from bloat- and malware.
I bought a refurbished Windows 8 PC (because cheap: few wanted it)
to experiment with dual-booting Linux on UEFI, which ultimately failed
but led to regular Windows 8.1 use with Cygwin, which with X mouse remains my go-to desktop.


FWIW, X-Mouse Button Control may be the best free Windows mouse tamer.
Windows 10 with WSL is promising, but frequently problematic M$ updates
make Windows 8.1 a more stable fully supported platform.

The scientific method wants repeatable results,
and processing by shell scripts minimizes randomizing by GUI fumbles.
Since Cygwin and MSYS2 are relatively obscure, most scripts get translated into .bat files for Windows' cmd.exe
Practically, msys2.exe is more powerful (resizeable and uses bash) than cmd.exe,
(with IMO less hassle than Linux distros) except that it does not recognize .bat files as executable.
However, msys2.exe console may run .bat files by e.g. $ cmd "/C trivial.bat".
GVIM can be configured for compatible copy and paste by mouse with Mys2.exe terminals..
divide and conquer
A UEFI PC can boot among multiple Windows installations,
with multiple user accounts on each customized for different purposes.
Sparse Desktops minimize confusing window overlaps,
e.g. with a single folder for commonly used utilities and the rest consumed by
web browser, file explorer and shell windows and e.g. GitHub Desktop

For Mac and Linux users, utilities with cross-platform support are preferred..
Windows user account home folders containing .bat files
help set custom PATH and work directory for various tasks.
If not with Cygwin, some PATH should include a usr\bin\ for git, grep, find, cat, paste etc.
Many applications bundle msys and or mingw;   separately installing another IMO
mostly wastes spaces and increases update maintenance.
A Ruby installation on my PC had the largest and most complete MSYS, so goes in PATHs.

With projects on a separate e.g. G: drive shared by all user ids and booted Windows partitions,
typing C: in cmd.exe returns to home directory.
Since e.g. GitHub Desktop frequently changes its path name for AppData resources,
modularize custom tool paths in a single bat file, e.g.:
C:\Users\ormpoa>type hdp.bat
@echo off
set GHDP=C:\Users\ormpoa\AppData\Local\GitHubDesktop
: GitHub Desktop version number changes frequently
set GV=%GHDP%\app-2.2.1
set GIT=%GHDP%\bin;%GV%\resources\app\git\mingw64\bin
set PY36S=C:\Users\ormpoa\AppData\Roaming\Python\Python36\Scripts
set PY=G:\Gateway\my\VS\Shared\Python36_64;%PY36S%
set WIN=C:\WINDOWS\system32;C:\WINDOWS
set MSYS=G:\Ruby25-x64\msys64\usr\bin
set DOT=C:\Program Files\dotnet
set GP=C:\Program Files (x86)\gnuplot\bin
.. so that e.g. a .bat file for gnuplot activity is:
C:\Users\ormpoa>type gplot.bat
@call hdp.bat
path=%GP%;%WIN%;%MSYS%
g:
cd \Gateway\GitHub\oristo\altervista\gnuplot
For tab completion, .bat filenames beginning uniquely is important..

MSYS2 testimonial
By comparison, here are corresponding lines in .bash_profile for msys2.exe consoles:
PATH=/bin:/c/Windows/System32:/c/Windows:/usr/bin/core_perl

# include user's private bin if it exists
if [ -d "${HOME}/bin" ] ; then
  PATH="${HOME}/bin:${PATH}"
fi

if [ -z "$GIT" ] ; then
# for compatibility with GitHub Desktop, use its binary
  GHDP="/c/Users/ormpoa/AppData/Local/GitHubDesktop"
# Version numbers change frequently:
  GV="${GHDP}/app-2.2.1"
  export GIT="${GV}/resources/app/git/mingw64/bin"
# if `where git` reports another, then delete or rename it
fi

if [ -z "$PY" ] ; then
# use Python from shared Visual Studio Community
  PY36S="/c/Users/ormpoa/AppData/Roaming/Python/Python36/Scripts"
  PY="/g/Gateway/my/VS/Shared/Python36_64:${PY36S}"
fi
PATH="${PATH}:${GIT}:${PY}" 
Regular gnuplot for Windows does not run from msys2.exe;
rather than installing gnuplot for mingw,
simply launch that Windows version in another window.

msys2.exe bash shell supports aliases, which can also be defined in .bash_profile, e.g.

alias nv='python nVargs.py'
alias pip='python -m pip'
# https://packages.msys2.org/base
alias install='pacman -S'
alias spell='aspell -c'
alias mn='cd /g/Gateway/my/nanoVNAsaver/'
if [ -d /g/Gateway/GitHub/oristo ] ; then
  alias g='cd /g/Gateway/GitHub/oristo'
fi