Code Monkey home page Code Monkey logo

mac-setup's Introduction


Mac Setup

Front End Web Development Setup for macOS



This document describes how I set up front end web development environment on my MacBook Air with macOS High Sierra 10.13.3.


Table of Contents


System Preferences

After clean install of operating system, there are a couple tweaks I like to make to the System Preferences. Some of them are not strictly related to web development enviroment - I use them because of my personal habits.

  • General > User dark menu bar and Dock
  • General > Ask to keep changes when closing documents
  • General > Close windows when quitting an app
  • Dock > Automatically hide and show the Dock
  • Keyboard > Key Repeat > Fast (all the way to the right)
  • Keyboard > Delay Until Repeat > Short (all the way to the right)

Set Dock size

$ defaults write com.apple.dock tilesize -int 35; killall Dock

Disable "Press and hold"

$ defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false

Reset icons in Launchpad

I usually use this command after installing every application that I need - it keeps Apple applications on the first page and moves the rest to the next pages.

$ defaults write com.apple.dock ResetLaunchPad -bool true; killall Dock

Show hidden files

This can also be done by pressing Command ⌘ + Shift ⇧ + ..

$ defaults write com.apple.finder AppleShowAllFiles YES

Show path bar in Finder

$ defaults write com.apple.finder ShowPathbar -bool true

Show status bar in Finder

$ defaults write com.apple.finder ShowStatusBar -bool true

Terminal

I use my custom Terminal profile called Flat. You can download it by typing:

$ curl -O https://raw.githubusercontent.com/appalaszynski/mac-setup/master/Flat.terminal

To use it as default profile open downloaded Flat.terminal file and click Shell > Use settings as default option.


Bash

# Aliases
alias brewup='brew update; brew upgrade; brew prune; brew cleanup; brew doctor; brew cask cleanup'
alias rmhis='rm .bash_history; history -c; logout'

# Colors for `ls` command output
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced

# Colors used in prompt
RED='\[\033[1;31m\]'
GREEN='\[\033[1;32m\]'
YELLOW='\[\033[1;33m\]'
PURPLE='\[\033[1;35m\]'
GRAY='\[\033[1;30m\]'
DEFAULT='\[\033[0m\]'

# Function used in prompt, displaying current Git branch
parse_git_branch() {
     git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}

# Prompt
export PS1="${RED}\u ${GRAY}${GREEN}\h ${GRAY}${YELLOW}\w${GRAY}\$([[ -n \$(git branch 2> /dev/null) ]] && echo \"\")${PURPLE}\$(parse_git_branch)\n${GRAY}\$ ${DEFAULT}"

In my .bash_profile file I create a brewup alias to keep Homebrew (which we are going to install in a second) up to date and rmhis to remove bash history. I also set color scheme for ls command output and for custom prompt which contains username, computer name, working directory and current Git branch.

To download .bash_profile and execute its content, use:

$ cd ~
$ curl -O https://raw.githubusercontent.com/appalaszynski/mac-setup/master/.bash_profile
$ source ~/.bash_profile

Homebrew

Homebrew package manager allows to install almost any app right from the command line.

Installation

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Usage

To install specific package use brew install <package> e.g.

$ brew install git

Brewfile

Installing each package separately may take some time. That's why I use Homebrew Bundle, which allows to automatically install all packages and applications listed in the Brewfile file.

Here are all the programs I install with a brief description.

Below are the entire contents of my Brewfile, which will install all the above programs with a single command.

tap 'caskroom/cask'

brew 'git'
brew 'mas'

cask 'appcleaner'
cask 'filezilla'
cask 'firefox'
cask 'flux'
cask 'fork'
cask 'google-chrome'
cask 'keepingyouawake'
cask 'keka'
cask 'mamp'
cask 'opera'
cask 'postman'
cask 'sequel-pro'
cask 'skype'
cask 'slack'
cask 'spectacle'
cask 'transmission'
cask 'visual-studio-code'
cask 'vlc'

mas "iMovie", id: 408981434
mas "Numbers", id: 409203825
mas "Pages", id: 409201541

To check App Store application's IDs use:

$ mas search <app name>

To download my Brewfile file type:

$ curl -O https://raw.githubusercontent.com/appalaszynski/mac-setup/master/Brewfile

To install listed applications use:

$ brew bundle

in directory that contains Brewfile file.


Git

You can set Git global configuration two ways. The first is to run bunch of commands which will update the Git configuration file, e.g.

$ git config --global user.name "First Last"
$ git config --global user.email "[email protected]"

The other and faster way is creating the Git configuration file and input it all ourselves.

$ cd ~
$ curl -O https://raw.githubusercontent.com/appalaszynski/mac-setup/master/.gitconfig
$ open .gitconfig
[user]
  name = First Last
  email = [email protected]
[github]
  user = username
[core]
  editor = editor
[credential]
  helper = osxkeychain

Here I set my name, email, GitHub username, core editor and connect Git to the macOS Keychain so I don’t have to type my username and password every time I want to push to GitHub.


Node.js

For installation of Node.js I like to use Node Version Manager (nvm). To download it type:

$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash

You can check all available Node.js versions by:

$ nvm list-remote

To install specific version type:

$ nvm install <version>

Node Package Manager

Packages which I use globally at the moment are:

To install them use:

$ npm install -g gulp-cli webpack npm-upgrade

Web Browsers

Currently I have installed all major web browsers:

For main development I use Google Chrome.

Chrome extensions


Visual Studio Code

All default settings changes are stored in settings.json file. You can open it by pressing Command ⌘ + , going to Code > Preferences > Settings. Here are my settings.json contents:

{
  "workbench.startupEditor": "newUntitledFile",
  "workbench.colorTheme": "Monokai",
  "workbench.activityBar.visible": false,
  "workbench.iconTheme": "material-icon-theme",
  "workbench.statusBar.feedback.visible": false,
  "editor.fontSize": 12,
  "editor.tabSize": 2,
  "editor.multiCursorModifier": "ctrlCmd",
  "editor.minimap.enabled": false,
  "editor.formatOnPaste": true,
  "editor.detectIndentation": false,
  "problems.decorations.enabled": false,
  "explorer.openEditors.visible": 0,
  "explorer.decorations.colors": false,
  "files.insertFinalNewline": true,
  "html.autoClosingTags": false,
  "files.exclude": {
    "**/node_modules/": true,
    "**/.vscode/": true,
  },
  "material-icon-theme.folders.theme": "none",
  "material-icon-theme.hidesExplorerArrows": true,
  "html-css-class-completion.enableEmmetSupport": true,
  "eslint.autoFixOnSave": true,
  "todohighlight.isEnable": true,
  "todohighlight.keywords": [
    {
      "text": "TODO:",
      "color": "black",
      "backgroundColor": "yellow",
      "overviewRulerColor": "yellow"
    },
    {
      "text": "FIXME:",
      "color": "white",
      "backgroundColor": "red",
      "overviewRulerColor": "red"
    }
  ],
  "todohighlight.exclude": [
    "**/public/"
  ],
}

You can copy and paste them or just download whole file by:

$ cd /Users/Your Username/Library/Application Support/Code/User
$ curl -O https://raw.githubusercontent.com/appalaszynski/mac-setup/master/settings.json

Extensions

mac-setup's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.