Categories
DevOps mac

Setting up a new Macbook for development

A mac is setup for the default user and usually requires a few things to make it into a development machine. It is certain that a fresh ubuntu install is more developer focused than a macbook. In this post I will walk you though what I do when setting up a new macbook for development.

  1. Install homebrew
  2. Install wget
  3. Install python with brew
  4. Download vs code
  5. Download the python extension for vscode
  6. Make tanner terminal the default

Then to improve on all bash (terminal), git and vim prompts etc we are going to use nicolas’s dotfiles, but to use that we have to install xcode from the appstore first. Then you may need to follow this stackoverflow answer if you have previously just installed xcode-command-line tools

Issues with the dotfiles setup

A few issues after installing the dotfiles is:

  • The annoying doink sound when pressing esc and then : in vim
  • The prompt is just showing the current location (it does not show currently logged in user and domain.
  • When moving the cursor or backspacing, if you hold it down for half a second half the characters will be skipped or deleted.

The annoying doink sound when pressing esc and then : in vim

You change this sound in settings -> sound -> alert sound

Cursor Backspace Issue

To fix the cursor and crazy fast backspace issue:


defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool true
defaults write NSGlobalDomain InitialKeyRepeat -int 25
defaults write NSGlobalDomain KeyRepeat -int 6

Changing Prompt colour

Ensure to install the tanner terminal and make sure it is the default terminal theme.

default-tanner-terminal

Incorrect Prompt

The prompt is not as I expected

It is showing:

necolas-dotfile-prompt

Folders and files with different permissions are not different colours

Try ls to have different colour output

I added an alias to ~/.bash_profile

alias ls='ls -G'

Relative paths are tab-completed to absolute paths

 

Terminal not exiting

Make the terminal exit when you type exit and avoid this annoying exit that doesn’t actually exit:

mac-terminal-annoying-exit-that-does-not-exit

You can fix this by changing the terminal settings

make-terminal-close-with-exit