Re'A Wiki: approximate knowledge of many things
  • Įvadas
  • Motyvacija
  • daily
    • 2024-02
      • 2024-02-18
  • apps
    • Apps
    • Jailbreak
    • Mac
    • Self Host
    • Software tools
  • archive
    • blog
      • 130 Vyrisku Dalyku
      • 2007 Vasara
      • 7 Efektyvaus Laiko Planavimo Zingsniai
      • A Tale Of Nice Guys
      • Apie Ateizma Bei Agnosticizma
      • Apie Geriausius Draugus Ir Drauges
      • Apie Grauztukus
      • Apie Kal Das
      • Apie Pinigus Ir Laisve
      • Apie Populiariuosius Vaistukus
      • Apie Rasyma
      • Apie Turinio Vartojima
      • Asmenyb S Tipas Intravertas
      • Ateitis Prasidejo
      • Atminties Rekonstrukcija
      • Atmintis
      • bandant-uzmigti...
      • Blogas
      • Blogadienis
      • Bob Knows Better
      • Creation Value
      • Drauga Pameciau
      • Filosofija
      • First Night
      • Freetime Egoist
      • Geocaching
      • Gera Buti Manimi
      • Grazi Moteris
      • Gyvenimas Kartu Su Mergina
      • Hekslis
      • Hysterical Literature Stoya
      • Im Sorry Tom But You Have To Run Again
      • Issukiai
      • Kai Sakoma Ne
      • Kaledu Lukesciai
      • Kasetes
      • Kinestetikas
      • Kovas
      • Kraunames Daiktus Studentavimui
      • Laiko Valiuta
      • Laisvo Laiko Pardavejas
      • Linkin Park Siemens Arena In 2008 06 10
      • Listen Think And Understand
      • Madinga
      • Mano Laidotuves
      • Mano Studijos Ir Profesine Karjera
      • Marble Hornets Siaubo Fenomenas
      • Maza Ispazintis
      • Mens Rea
      • Miestelio Persekiojimai
      • Moterys Su Kuriomis Draudziama Susitikineti
      • Nauja Aistra Fed 3
      • Nesusitikinek Su Mergina Kuri Keliauja
      • Noblesse Oblige
      • Nusisauti Su Duru Rankena Greiciau
      • Ode To The Nice Guys
      • Pakeisti Pasauli Taip Jog Tai Kazka Reikstu
      • Pavydas
      • Pervertinimo Efektas
      • Piratavimas Arba Skaitmeninio Turinio Mokejimo Ypatumai
      • Pirmieji Studij Metai
      • Praeitimi Tapusios Technologijos
      • Puse Lito
      • Rasau
      • Sapnas Su Olga
      • Savaitgalis Sibire
      • She And Her Cat
      • Snipai Tarp Gyvun
      • Stylish Blog Award
      • Su Negimimo Diena
      • Sugadintas Poziuris
      • Sushi Valgymo Etiketas
      • Television
      • Tesejo Laivas
      • The illiterate of 21st century
      • Them
      • tiesa-slypi...
      • Tinklai Ir Vardai
      • Tobulos Merginos Tipazas
      • Trikampiai
      • Tukstantmecio Suva
      • Uzpuolikas
      • Vyru Ir Moteru Neistikimybe
      • Vyru Taisykles Moterims
      • Istorija
        • 44 Pragaro Dienos
        • Baychimo Laivas Vaiduoklis Nenorejes Nuskesti
        • Desimtmecio Prognozes
        • Visu Laiku Ieskomiausias Banku Plesikas
        • Visu Laiku Pavojingiausias Ivanas
        • Zudynes Mokyklu Koridoriuose
      • it-talk
        • 1440p prieš 120Hz monitorių
        • 3 Didieji Telefonu Bateriju Mitai
        • Android Iniciatyva Pavadinimu Project Volta
        • Apie Apple Eventa
        • Apie Branduolius Ir Telefonus
        • Apie Hdmi
        • Apie Superkompiuterius Ir Dirbtini Intelekta
        • Apie Windows 8
        • Apple Ir Google Naujienos
        • Apple Laikas Pradeti Gaminti Savo Paciu Procesorius
        • Ar Nokia Sugrizimas Galimas Tik Su Android
        • Audio Knygos
        • Aukstos Klas S Ausin S
        • Diskusija Apie Windows 8
        • Ios Jailbreakas Ir Ka Su Juo Veikti
        • Ios User Experience
        • IT Talk
        • Kaip Tadas Narsykles Kaitaliojo
        • Kompiuterio Rinkimas
        • Megapikseli Mitas
        • Mintys Apie Apple Watch
        • Ms Surface Naujas Zingsnis Planseciu Evoliucijoje
        • Ne Viskas Pazanga Kas Pazanga Kvepia
        • Nvidia G Sync
        • Pats metas įsigyti PS3
        • Protingesnis Ekrano Apsvietimas Skaitymui Vakare
        • Raw Particija
        • Reklamos Utorrent Programoje
        • Samsung Galaxy S5
        • Ssd Diskai
        • Windows 7 Galimyb S Video Apzvalga
        • Windows 7 Galimybes Video Apzvalga
      • redditbest
        • Did Any Of Leonardo Da Vincis Research Actually Lead To Technological Advancement
        • Double Standard
        • Girl Out In The Cold
        • Knowledge Is Power France Is Bacon
        • Kokia Eilute Kardinaliai Pakeite Jusu Mastysena
        • RedditBest
        • today-you....-tomorrow-me
        • What Are The Defining Photographs Of This Generation
        • What Is A Story You Have Been Dying To Tell
        • What Is The Laziest Thing Youve Ever Done
        • What Is The Nicest Thing Youve Ever Done That No One Knows About
        • What One Thing Has Always Bothered You But Seems To Bother No One Else
        • Whats One Harsh Truth When It Comes To Dating Relationships
        • writingpromt-a-wife-kills-her-husband.-make-me-sympathize-with-both-characters
    • muzikos-virtuve
      • Muzikos Virtuvė straipsniai
    • straipsniu-archyvas
      • Everything You Know About Fitness is a Lie
      • Ilga blevyzga apie visas gyvenimo vasaras
      • Kodėl jauni žmonės neturi darbo ir ką daryti, kad tu jį visuomet turėtum
      • Niekam neįdomu, kiek daug tu dirbi
      • Pasikutenkim jausmus, 90-ųjų vaikai
      • Peter Pan generation
      • Privalai pradėti investuoti. Dabar
      • Straipsnių archyvas
      • The Brain On 23
    • tech-it
      • tech-it
  • citatos
    • Citatos
    • Showerthoughts
  • dev
    • Algoritmai
    • apis
    • CI/CD
    • Databases
    • DEV
    • Tools
    • linux
      • Linux
      • Yubikey for SSH login
    • mac
      • Set Up For Web Development
    • php
      • PHP
      • Wordpress
  • karjera
    • Karjera
    • Remote work
  • media
    • Filmai
    • Muzika
    • Videos
    • knygos
      • Andrius kleiva - Kaip veikia Japonija
      • Beigbeder – Meilė trunka trejus metus
      • Carlos Gil - The End of Marketing
      • Cary Cooper, Sean O'Meara - The Apology Impulse
      • George S. Clason - The Richest Man in Babylon
      • Joseph Pisenti - Answers to Questions You’ve Never Asked
      • Knygos
      • Martin Page – Kaip aš tapau kvailiu
      • Naujųjų laikų Evangelija pagal Užkalnį
      • Protingos Labai Mažo Protelio Meškiuko Mintys
      • Sarah Knight - You Do You
      • Scott Barry Kaufman - Transcend
    • zaidimai
      • Bioshock
      • Burly Men At Sea
      • Erica
      • Little Alchemy
      • PS4 games
      • Starcraft II: Wings Of Liberty
      • Žaidimai
      • Žaidimų evoliucija
      • stalo-zaidimai
        • Cards Against Humanity
        • Secret Hitler
        • Stalo žaidimai
  • mityba
    • Britų trumpaplaukio mityba
    • Ketogeninė dieta
    • Medicininiai grybai
    • Mityba
    • Protarpinis badavimas
    • Receptai
  • pasaulis
    • COVID-19
    • Pasaulis
    • keliones
      • Barcelona (2019)
      • Graikija (2018)
      • Kelionės
      • Kompensacijos už vėluojantį skrydį išmušimo instrukcija
      • Tel Aviv (2019)
      • Tailandas (2015)
        • Tailandas (2015)
        • Kelionės info
    • politika
      • Politika
    • valstybes
      • Japonija
      • Kinija
      • Rusija
      • UK
      • Valstybės
      • Vokietija
  • pinigai
    • Pinigai / finansai
    • Verslas
    • investavimas
      • Akcijos
      • Crypto
      • Investavimas
  • pirkiniai
    • Buy it for life
  • skaitiniai
    • Mental modeliai
    • Skaitiniai
    • Teorijos / efektai
    • Terminai
  • social
    • Komunikacija
    • Kūrybingumas
    • Socialines Klases
    • zmones
      • Bruce Lee
      • Elon Musk
      • George Carlin
      • Jackie Chan
      • Kevin Hart
      • Michael Jackson
      • Asmenybės
      • me
        • Doša testas
        • Apie mane
        • Vestuvių įžadai
  • tech
    • Ai
    • Tech
    • gadgets
      • Gadgets
      • PC build
      • apzvalgos
        • Apžvalgos
        • Dell Inspiron 15 7559
        • Garmin Virb Ultra 30
        • Koss The Plug
        • samsung-galaxy-tab-10.1
        • Sony Ericsson Xperia X10 Mini Pro
        • Toshiba A300-1GN
      • bevieles-ausines
        • Airpods Pro
        • Bevielės ausinės
    • kompanijos
      • Apple
      • kompanijos
      • Neurolink
      • Spacex
    • mac
      • ios
Powered by GitBook
On this page
  • macOS Settings
  • System preferences
  • Finder
  • Screenshot
  • macOS Shortcuts
  • Command-line Tools
  • Homebrew
  • iTerm2
  • Git
  • Zsh
  • Oh My Zsh
  • Node.js
  • Docker
  • tldr
  • htop

Was this helpful?

  1. dev
  2. mac

Set Up For Web Development

PreviousmacNextphp

Last updated 1 year ago

Was this helpful?

A guide to getting your Macbook ready for web development — tools, shortcuts, accessories, tips and tricks, and more.

I recently switched jobs, and during the first few days on the new job, I had to setup a MacBook with all the tools required for me to do my job, web development. Although, I’ve used Macs for a long time, at my previous job I was developing on a PC with Windows 10. It was surprisingly pleasant and productive once I got up and running, but I’m really glad to have a Mac as my primary workstation once again.

Every now and then, I look for guides like this one to see what tools people are using and to get productivity tips. And almost always I learn about something new that makes my life as a developer easier. I’ve kept notes of all the things I installed and configured during the first weeks on the new job hoping it’d be useful to other developers.

macOS Settings

Let’s start with a few changes you can make to macOS and the built-in apps.

System preferences

Keyboard Keyboard > T️️ouch Bar Shows: F1, F2, etc. Keys Keyboard> Press Fn key to: Show Control Strip

These two settings are about the touch bar. As a developer, I find myself using the F keys more often (a lot of shortcuts rely on them) than the other options — thus I prefer to have them be the default.

Dock ️️☑️ Automatically hide and show the Dock

More often than not, I use Spotlight (⌘ Space) or the terminal to launch applications instead of the dock — it’s hard to justify dedicating such display real estate to it. Besides, you can easily access it by moving your mouse to the bottom of the screen or by pressing ⌃ F3.

Trackpad Point & Click > ️️☑️ Tap to click

Once you get used to it, it’s way faster to tap instead of click.

Accessibility Pointer Control > Mouse & Trackpad > Trackpad Options… > ️️☑️ Enable dragging

By enabling trackpad dragging, you’ll be able to drag files, select text, etc., by double tapping (and holding the second tap).

Finder

Preferences Preferences > Advanced > ☑️ Show all filename extensions

View options View > Show Path Bar View > Show Status Bar

Show hidden files Type defaults write com.apple.Finder AppleShowAllFiles true in terminal, or press ⇧⌘ .

Screenshot

Change where screenshots are saved Open the Screenshot app via Spotlight search or by pressing ⇧⌘ 5, find the Options menu at the bottom of the screen, then select a folder under Save to

macOS Shortcuts

System wide Spotlight search: ⌘ Space Character Viewer: ⌃⌘ Space (Quickly find emojis and special characters) Force quit an app: ⌥⌘ Esc Lock screen: ⌃⌘ Q Show or hide the Dock: ⌃ F3 or ⌥⌘ D Show all windows: ⌃ Arrow-Up Show all windows of the front app: ⌃ Arrow-Down Forward delete: fn delete Paste without formatting: ⇧⌘ V

Screenshot Open Screenshot app: ⇧⌘ 5 Save screenshot of the screen: ⇧⌘ 3 Save screenshot of a portion of screen: ⇧⌘ 4 Save screenshot of a window: ⇧⌘ 4 + Space Copy screenshot of the screen: ⇧⌃⌘ 3 Copy screenshot of a portion of screen: ⇧⌃⌘ 4 Copy screenshot of a window: ⇧⌃⌘ 4 + Space

Finder Open the home folder: ⇧⌘ H Open the desktop folder. ⇧⌘ D Open the parent folder: ⌘ Arrow-Up Go to the previous folder: ⌘ [ Go to the next folder: ⌘ ] Show or hide hidden files: ⇧⌘ .

Command-line Tools

Now to the fun part. These are the command line–related tools I recommend for any web developer.

It’s the package manager. It allows you to install, uninstall, and update command-line tools and Mac applications.

To install it, open the terminal, and run this command:

/bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

During the installation, you might be asked to install the Xcode Command Line Tools if you haven’t already. Just follow the instructions on the screen.

To make sure your system is ready to brew, run brew doctor.

You can now search for packages with brew search and install them with brew install (for command-line tools) and brew cask install (for macOS applications).

You can list installed packages with brew list and brew cask list.

To update the packages’ local registry you can run brew update, and to upgrade the installed packages to their latest versions, type brew upgrade.

I recommend running brew doctor every now and then to make sure things are good and brew cleanup to remove unused files.

To install it, open the terminal (this is the last time you’ll need it), and run:

brew install --cask iterm2

Now, feel free to replace terminal from the Dock (if you have it) with iTerm2. Or just open Spotlight and type iTerm2.

Hotkey window You can show or hide the iTerm2 window via a hotkey from anywhere very quickly.

Preferences > Keys > Hotkey > ☑️ Show/hide all windows with a system-wide hotkey

I recommend using ⌘ ` as the hotkey.

Unixyness Copy on selection, paste on middle click, and focus follow the mouse.

Preferences > General > Selection > ☑️ Copy to pasteboard on selection Preferences > Pointer > General > ☑️ Three-finger tap emulates middle click Preferences > General > Pointer > ☑️ Focus follows mouse

Disable native full screen By disabling native full screen, you can quickly make iTerm2 take the whole screen without the usual full-screen animation.

Preferences > General > Window > ☐ Native full screen windows

Shortcut for full screen: ⌥ Return

Split panes You can divide up your tabs into multiple panes with separate sessions and quickly switch between them. This works very nicely with focus-follow mouse.

Right Click > Split Pane Vertically Right Click > Split Pane Horizontally

I recommend creating new key bindings for those actions: Preferences > Keys > Key Binding > + I use ⌥ v and ⌥ h.

Shell integration You can enable better integration between your shell and iTerm2.

iTerm2 > Install Shell Integration

Then, add the following to your .zshrc (more details about Zsh can be found in the next sections): source ~/.iterm2_shell_integration.zsh.

Profile settings Feel free to explore these settings and configure your profile to your liking. I recommend experimenting with background opacity and blur.

The most popular version-control system. You should install it with Homebrew before continuing:

brew install git

As macOS’s default shell since Catalina, Zsh is built on top of Bash and provides a lot of cool features.

The first thing I recommend is having Homebrew manage its installation — open iTerm2, and run:

brew install zsh

To update our default shell to be Homebrew’s Zsh, we need to edit the shell’s whitelist: sudo vim /etc/shells. (If you’re not comfortable with Vim, you can use TextEdit instead by running sudo open /etc/shells.)

Add a new line with /usr/local/bin/zsh, save, and close.

To change the default shell, run: chsh -s /usr/local/bin/zsh.

Restart the terminal, and confirm we’re on the correct Zsh by running: echo $SHELL. You should see /usr/local/bin/zsh.

Tab completion

Press TAB to complete a command:

Zsh will show you all the available commands you can use. If you press TAB again, you’ll be able to navigate between the options by pressing TAB or the RIGHT and LEFT arrows. Confirm the command you want by pressing SPACE or RETURN.

Press TAB to complete file and folder names:

And it’s smart enough if you type just a substring: cd p/s<TAB> expands to cd project/src.

Globbing (aka filename generation) List only files in the current directory: ls *(.)

List only folders in the current directory and its subdirectories: ls **/*(/)

Remove all .DS_Store files recursively: rm -rf **/.DS_Store. (If you want to be sure which files will be deleted, you can press TAB before running the command, and Zsh will expand the pattern)

And my list of keyboard shortcuts:

Regardless of its odd name, Oh My Zsh is a community-driven framework for managing your Zsh configuration. It provides hundreds of plugins and themes and makes configuring Zsh a breeze.

To install Oh My Zsh, run:

sh -c “$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

It has a really nice wizard that walks you through configuring it the first time that you run it:

To install it with Homebrew, run:

brew install romkatv/powerlevel10k/powerlevel10k

And add the following line to your .zshrc: source /usr/local/opt/powerlevel10k/powerlevel10k.zsh-theme

It’ll override any value you have set $ZSH_THEME to.

Restart iTerm2, and you should see the configuration wizard. In the future, you can run it again with p10k configure.

Zsh plugins

To install it, run:

brew install zsh-syntax-highlighting

And add the following line to your .zshrc: source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

To install it, run:

brew install zsh-autosuggestions

And add the following line to your .zshrc: source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh

To install it, run:

brew install zsh-history-substring-search

And add the following line to your .zshrc: source /usr/local/share/zsh-history-substring-search/zsh-history-substring-search.zsh

Also, you need to map your arrow keys. Add the following after the source command.

bindkey '^[OA' history-substring-search-upbindkey '^[OB' history-substring-search-down

For example, to install all the recommended plugins:

plugins=(alias-finder brew common-aliases copydir copyfile docker docker-compose dotenv encode64 extract git jira jsontools node npm npx osx urltools vi-mode vscode web-search z)

Aliases Often-used commands can be abbreviated with an alias. alias tf=”tail -f” makes it so you can run tf instead of typing tail -f.

You can add as many aliases as you want to your .zshrc.

Plugins like Git and Common Alias add a lot of aliases that’ll make you type less. But it can be hard to learn them all. That’s what the alias-finder plugin is for.

If you want to know what aliases exist for, it’s git commit:

You can also set ZSH_ALIAS_FINDER_AUTOMATIC=”true” in your .zshrc to have it run automatically before each command.

There are three types of aliases:

  • command aliases: just like the tf example above

  • global aliases: which are substituted anywhere on a line. For example, the G alias added by the common-aliases plugin gets replaced by | grep. ls G foobar => ls | grep foobar

  • suffix aliases: These are special aliases that are triggered when a file name is passed as the command. For example: alias -s pdf=acroread invokes acroread when you run file.pdf.

Command aliases can also access the original command’s arguments by using the array $:

loop() {  for x in {1..$1}; do $@[2,-1]; done}

This alias runs a given command x times. For example: loop 10 echo ‘hello’ will print hello 10 times.

The JavaScript runtime built on Chrome’s V8 JavaScript engine. It’s the most popular framework for running and building web applications.

To install it, run:

brew install node

Docker allows you to develop and deliver software in packages called containers. Containers are isolated from one another and bundle their own software, libraries and configuration files.

To install it, run:

brew install --cask docker

A collection of simplified and community-driven man pages.

To install it, run:

brew install tldr

It’s similar to top but allows you to scroll vertically and horizontally so you can see all the processes running on the system, along with their full command lines.

To install it, run:

brew install htop

Source

These are some the mac shortcuts I use the most (I won’t list the very basic ones like ⌘ C, ⌘ V, ⌘ Tab, etc.). For a more comprehensive list, click .

It’s a replacement for the terminal. It offers a that are really useful. I’ll list my favorite ones below.

See the for more information.

Visual Studio Code supports Git (and several other VCSs via extensions). But if you want to take your Git via CLI to the next level, you should check out and/or .

If you want better diffs, check out .

Now, we have access to features. My favorites are:

Command completion

File and folder completion

There are you can use to target files with specific attributes. You can enable the more complex ones by running setopt extended_glob.

’s one command to recursively match all normal files that have no uppercase characters or numbers in the name. They’re executable for the owner but not for the rest of the world. The owner must have the UID 1002, the file size must be above 30MB, and it must have been modified within the last month: ls -l **/([^A-Z[:digit:]])##(#q.x^X^u1002Lm+30mM-1)

You can find many other useful tips .

We can configure Zsh by running vim ~/.zshrc or (open ~/.zshrc if you prefer TextEdit over Vim). You’ll see a lot of configurations added by Oh My Zsh that you can play with. If you ever need to reset your .zshrc, you can find the template .

I’ll list my recommendations below, but I highly recommend you browse the available and later.

Theme is my theme of choice — it’s fast, it’s , it supports icons, and .

Powerlevel10k configuration wizard

I highly recommend enabling .

: It enables highlighting of commands while they’re typed. This helps in reviewing commands before running them, particularly in catching syntax errors.

zsh-syntax-highlighting examples

: It suggests commands as you type based on your history and completions.

zsh-autosuggestions demo

: Type in any part of any command from your history, and then press chosen keys, such as the UP **** and DOWN **** arrows, to cycle through matches.

zsh-history-substring-search demo

If you want to use along with this script, then make sure you load it before you load this script.

Oh My Zsh plugins The following plugins are made available by Oh My Zsh, like any other plugin found . To install it, just add its name to the plugins array in your .zshrc file.

: This plugin searches the defined aliases and outputs any that match the command inputted. This makes learning new aliases easier.

: The plugin adds several aliases for common commands

: This plugin creates helpful shortcut aliases for many commonly used commands

: Copies the path of your current folder to the system clipboard

: Puts the contents of a file in your system clipboard so you can paste it anywhere

: This plugin adds auto-completion for .

: This plugin provides completion for — as well as some aliases for frequent Docker Compose commands

: Automatically load your project ENV variables from a .env file when you cd into the project root directory

: Alias plugin for encoding or decoding using the base64 command

: This plugin defines a function called extract that extracts the archive file you pass it, and it supports a wide variety of archive file types

: Provides many and a few useful

: CLI support for Jira interaction

: Handy command-line tools for dealing with JSON data

: This plugin adds the node-docs function, which opens the specific section in the documentation

: The npm plugin provides completion as well as adding many useful aliases.

: This plugin automatically registers the npx command-not-found handler if npx exists in your $PATH

: This plugin provides a few utilities to make it more enjoyable on macOS

: This plugin provides two aliases to URL encode and URL decode strings

: This plugin increase Vi-like Zsh functionality

: This plugin makes interaction between the command line and the VS Code editor easier

: This plugin adds aliases for searching with Google, Wikipedia, Bing, YouTube, and other popular services

: This plugin defines the that tracks your most visited directories and allows you to access them with very few keystrokes

‘alias-finder’ example

If you need to manage multiple applications that need different versions of Node, I recommend .

You should also check out , a great CLI tool for docker and docker-compose.

tldr example

WSL
here
Homebrew
iTerm2
lot of features
docs
Git
lazygit
forgit
Delta
Zsh
many
lots of qualifiers
Here
here
Oh My Zsh
here
themes
plugins
Powerlevel10k
really well integrated with Git
a lot more
Transient Prompt
zsh-syntax-highlighting
zsh-autosuggestions
zsh-history-substring-search
zsh-syntax-highlighting
here
alias-finder
brew
brew
common-aliases
copydir
copyfile
docker
Docker
docker-compose
Docker Compose
dotenv
encode64
extract
git
aliases
functions
jira
jsontools
node
Node.js
npm
npx
osx
urltools
vi-mode
vscode
web-search
z
z command
Node.js
nodenv
Docker
lazydocker
tldr
htop
https://betterprogramming.pub/setting-up-your-mac-for-web-development-in-2020-659f5588b883