Setting up a Mac Laptop for a Software Engineer Coming from a Linux Desktop

I’ve recently started a new job and am setting up a MacBook Pro M4. I’ve been using either a native Linux Desktop, or a Linux Desktop as a VM on a Windows box for most of my career. There are a number things about the Mac that are different than Intel based machines running Linux following are the list of changes that I have made to make it usable as a development environment.

Disable the “Press and Hold” Feature

By default, holding down a given key will display a pop-up/tooltip that displays accented version of the given character. I use a Vim plugin with the IDEs that I use and when trying to navigate by holding down either the w or b chars the cursor only moves by one work and then shows an accented character. To disable it

  1. Run the following command in a terminal and then restarting applications. This turns off the feature that will show accented characters: defaults write -g ApplePressAndHoldEnabled -bool false
  2. Turn up the Key Repeat rate by going to System Setting > Keyboard and adjust the slider for the “Key repeat rate”. If this still feels too slow you can crank it up with the following terminal settings which enable values much lower than the UI allows to be set
# Sets a very short delay before repeating
defaults write -g InitialKeyRepeat -int 15 

# Sets a very fast repeat rate
defaults write -g KeyRepeat -int 2

Configuring Home and End Keys

  1. Create the following directory: mkdir -p ~/Library/KeyBindings
  2. Create and edit the binding file vi ~/Library/KeyBindings/DefaultKeyBinding.dict
  3. Paste the following content into it
{
    "\UF729" = "moveToBeginningOfLine:";
    "\UF72B" = "moveToEndOfLine:";
    "$\UF729" = "moveToBeginningOfLineAndModifySelection:";
    "$\UF72B" = "moveToEndOfLineAndModifySelection:";
}

Then save and close that file and restart applications and/or restart the Mac.

Leave a Reply