Switching to Mac from Windows or Linux: essential guide
How to struggle less with Mac when switching?
Mac configuration
If you're coming from Windows and/or Linux background getting used to Mac OS could be difficult. I use Mac at work but at home I use Ubuntu (for work) and Windows (for gaming and video editing).
It wasn't easy to get used to Mac. After some trial and error, I managed to create a more or less similar experiences for all three operating systems.
I don't remember what adjustment I had to make with Windows and Ubuntu (those are probably for different blog posts anyway), but my memories about required adjustments for Mac are quite fresh.
In this short guide (which I am intending to update as I go) I will help you to create a more familiar experience with Mac OS.
Keyboard and mouse
Let's start with very basic things. You must have noticed that Mac has a different keyboard. In my case, I connected an external non-Mac keyboard to Mac.
The other problematic thing is the mouse acceleration which might be good with trackpad, but absolutely horrible with an external mouse.
Below is the list of things I had to do to make it all usable.
Configure keyboard
Reassign external keyboard keys - swap
control
(win
on external board) andcommand
buttonsConfigure
win+shift+s
shortcut for screenshotConfigure
contrl+win+left/right
to switch between spaces
Add new shortcuts to lock the computer and to tile windows left and/or right
Open
System Preferences
Go to
Keyboard Preference Pane
Go to
Shortcuts
tabSelect "App Shortcuts"
Click "+"
Select "All Applications", "Lock Screen" and type shortcut (
win+l
) on external keyboardSimilarly add shortcuts to tile window left/right (
win+left/right
)
Configure Trackpad
- Allow selecting text with trackpad (double tap selection) -> select "Enable dragging" -> "without drag lock"
Enable tap on touchpad
System Preference
->trackpad
->tap to click
Disable mouse acceleration
This will make mouse to behave more like Windows/Linux
Open terminal and run following command:
defaults write .GlobalPreferences com.apple.mouse.scaling -1
- More info here: osxdaily.com/2010/08/25/mouse-acceleration
Configure terminal
While Mac OS does have Bash out of the box, it is still far from a good state, especially comparing to very colourful and user-friendly Ubuntu Bash. Let's change that!
Change default terminal to Bash
Add this to
.bashrc
file:
# for Brew
export PATH="/opt/homebrew/bin:$PATH"
# Hides the default login message
export BASH_SILENCE_DEPRECATION_WARNING=1
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color|*-256color) color_prompt=yes;;
esac
# Enable colors in bash
export CLICOLOR=1
export LSCOLORS=GxBxCxDxexegedabagaced
# get current git branch
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
# if working directory is too dark change [01;34 to [01;36
# find username@hostname:$
export PS1="\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[0;32m\]\$(parse_git_branch)\[\033[00m\]\$ "
# This turns on git autocomplete in terminal
[ -f /Library/Developer/CommandLineTools/usr/share/git-core/git-completion.bash ] \
&& . /Library/Developer/CommandLineTools/usr/share/git-core/git-completion.bash
Apps to install/configure
Unlike Linux lots of helpful software is missing and has to be downloaded elsewhere. Below is the list of absolutely essential apps to have
Pinta (to replace missing Paint)
Parallels + Windows (allows to use Windows apps like Mac-native)
Homebrew (brew.sh)
altTab extension (alt-tab-macos.netlify.app)
Configure VIM (github.com/senpay/vim_commands_and_keys/blo..)
Commander One for file browsing (mac.eltima.com/commander-one-download.html)
Add this to
settings.json
for VSCode + Vim plugin:
"vim.useSystemClipboard": true,
"vim.handleKeys": {
"<D-d>": false
}
Add SSH-AGENT to startup
Many tutorials for using ssh-agent recommend running/adding to .bashrc this command:
eval $(ssh-agent
It indeed starts ssh-agent, but would do it every time you start your terminal. At the end of the day, there may be dozens or even hundreds instances of ssh-agent running.
There's a simple trick to avoid that. Create a file with a name ssh-agent.plist in the /Library/LaunchDaemons folder (will require route access) with the following content:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>ssh-agent</string>
<key>ProgramArguments</key>
<array>
<string>eval</string>
<string>$(ssh-agent)</string>
</array>
</array>
<key>KeepAlive</key>
<true/>
</dict>
</plist>
Now ssh-agent will start only once on boot!
Other
Remember to use
control+space
instead ofwin
buttonOptionally enable zoom in
Accessibilities
(control + scroll
in mac keyboard,win + scrool
on external)Keyboard differences explained: oreilly.com/library/view/switching-to-the/9..
Install tinkertool to be able to change fonts
Finally
I hope this was a helpful guide. Switching from Windows to Mac may be a bit challenging, but after some time working with Mac can be a nice experience. Of course, it is not as gamer-friendly as Windows and not as power user-friendly as Ubuntu, but it does the job and looks pretty.
Please comment if you think it should be amended or updated.
PS
I hope you enjoy my blog. Did you know that I have YouTube channel as well? On this channel I explain:
Developers how to write cleaner and more testable code. TDD, Clean Code, XP, Agile, these sorts of things.
SDET and TA Engineers - how to create efficient automated testing. Test automation, test strategy, DevOps.
Junior developers - the fundamentals they need to know to build a successful career. Data Structures and Algorithms, career progression and interviewing tips.
If it sounds interesting - please subscribe here: youtube.com/channel/UCkJRvCK2-l2gCuPT9-HUG7A