Pular para o conteúdo principal

Configurações iniciais para desenvolvimento no Mac

· 5 min para ler
Leandro Andrade
Leandro Andrade
Software Developer

Configurações iniciais para Mac:

Inicio

Instalar homebrew:

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

Atualizar homebrew:

brew update

Shell Programs

brew install git \
htop \
poppler \
jq \
pyenv \
nvm \
ripgrep \
fd \
neovim

GUI programs

brew install --cask \
visual-studio-code \
google-chrome \
rectangle \
orbstack \
postman \
nordvpn \
brave-browser \
cryptomator \
vlc \
latest \
appcleaner \
ghostty \
proxyman \
microsoft-edge \
onedrive \
cleanshot \
bitwarden \
updf

Softwares Adicionais

  • intellij
  • webstorm
  • datagrip
  • parallels

Git

Configurar gitconfig

touch ~/.gitconfig

Configurações:

[user]
name = username
email = email
[github]
user = username_github
[includeIf "gitdir:~/some/dir/"]
path = .another_gitconfig
[init]
defaultBranch = main
[pull]
rebase = true
[alias]
i = init
a = add
cm = commit -m
cma = commit --amend
cmam = commit --amend -m
s = status
pom = push origin main
pog = push origin gh-pages
puom = pull origin main
puog = pull origin gh-pages
cob = checkout -b
co = checkout
db = branch -d
dbr = push origin --delete
fp = fetch --prune --all
rs = reset --soft
rh = reset --hard
l = log --oneline
lg = log --oneline --decorate --graph
lga = log --oneline --decorate --graph --all
lgs = log --oneline --decorate --graph --stat
lt = log --graph --decorate --pretty=format:'%C(yellow)%h%Creset%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)%an%Creset'

ohmyzsh

Instalar ohmyzsh

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

.zshrc

Configurar .zshrc


## configs
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"

export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init - zsh)"

## aliases
alias ctop='docker run --rm -ti --name=ctop --volume /var/run/docker.sock:/var/run/docker.sock:ro quay.io/vektorlab/ctop:latest'
alias ctar='tar -czf'
alias untar='tar -zxf'

nvm

Instalar nodejs:

nvm install v22.18.0

Definir a versão default:

nvm alias default v22.18.0

pyenv

Instalar python:

pyenv install 3.11.1

Definir a versão default:

pyenv global 3.11.1

Mac

Configurações do MacOS:

# Setting faster keyboard repeat rates...
defaults write -g InitialKeyRepeat -int 10 # normal minimum is 15 (225 ms)
defaults write -g KeyRepeat -int 1 # normal minimum is 2 (30 ms)

# Finder preferences Configuring enhanced Finder settings...
defaults write com.apple.finder AppleShowAllFiles YES
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"
defaults write com.apple.finder ShowPathbar -bool true
defaults write com.apple.finder ShowStatusBar -bool true
defaults write com.apple.finder _FXSortFoldersFirst -bool true
defaults write com.apple.finder NewWindowTarget -string "PfHm"
defaults write com.apple.finder NewWindowTargetPath -string "file://${HOME}/"
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"

# System preferences configuring enhanced system and trackpad settings..."
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadThreeFingerDrag -bool true
defaults write com.apple.AppleMultitouchTrackpad TrackpadThreeFingerDrag -bool true

# Text and input preferences configuring enhanced text and input settings..."
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool false
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
defaults write NSGlobalDomain NSTextMovementDefaultKeyTimeout -float 0.03

# Save and print dialog - expanding save and print dialogs by default..."
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true

# Performance and UI enhancements - optimizing window and UI performance..."
defaults write NSGlobalDomain NSWindowResizeTime -float 0.001
defaults write NSGlobalDomain NSToolbarTitleViewRolloverDelay -float 0

# Screenshot settings - configuring enhanced screenshot settings..."
mkdir -p ~/Screenshots
defaults write com.apple.screencapture type -string "png"
defaults write com.apple.screencapture "include-date" -bool "true"
defaults write com.apple.screencapture location -string "$HOME/Screenshots"
defaults write com.apple.screencapture disable-shadow -bool true

## Preventing .DS_Store file creation on network and USB volumes...
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true

chflags nohidden ~/Library

# Dock settings - Removing Dock animation delays and clearing default apps..."
#defaults write com.apple.Dock autohide-delay -float 0
#defaults write com.apple.dock autohide-time-modifier -float 0
defaults write com.apple.dock expose-animation-duration -float 0.1
defaults write com.apple.dock springboard-show-duration -int 0
defaults write com.apple.dock springboard-hide-duration -int 0
defaults write com.apple.dock springboard-page-duration -int 0
#defaults write com.apple.dock persistent-apps -array
defaults write com.apple.dock mru-spaces -bool false

# Impede que aplicativos mudem automaticamente de Space ao serem focalizados
defaults write NSGlobalDomain AppleSpacesSwitchOnActivate -bool false

# Setting default save location to local disk instead of iCloud...
defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false

# Disable Apple Intelligence
defaults write com.apple.CloudSubscriptionFeatures.optIn "545129924" -bool "false"

# Mostra percentual da bateria
defaults write com.apple.menuextra.battery ShowPercent -string "YES"

# Ativa zoom do mouse com scroll (útil para designers/desenvolvedores)
defaults write com.apple.universalaccess closeViewScrollWheelToggle -bool true

# Ativa menu de desenvolvedor
sudo defaults write com.apple.Safari IncludeInternalDebugMenu -bool true

# Remove animações do Safari
sudo defaults write com.apple.Safari WebKitInitialTimedLayoutDelay 0.25

# Desabilita as etiquetas no Finder
defaults write com.apple.finder ShowRecentTags -bool false

# Remove etiquetas da sidebar
defaults write com.apple.finder SidebarTagsSctionDisclosedState -bool false

Vscode

Configuração do arquivo settings.json:

{
"editor.tabSize": 2,
"security.workspace.trust.untrustedFiles": "open",
"editor.minimap.enabled": false,
"git.ignoreMissingGitWarning": true,
"editor.fontSize": 12,
// "editor.occurrencesHighlight": "off",
// "editor.selectionHighlight": false,
"editor.suggestOnTriggerCharacters": false,
"editor.tabCompletion": "on",
"editor.quickSuggestions": {
"other": false,
"comments": false,
"strings": false
},
"files.trimTrailingWhitespace": true,
"git.confirmSync": false,
// "window.menuBarVisibility": "compact",
"git.openRepositoryInParentFolders": "always",
"extensions.ignoreRecommendations": true,
"window.titleBarStyle": "custom",
"workbench.iconTheme": "vscode-icons",
"vsicons.dontShowNewVersionMessage": true,
"update.showReleaseNotes": false
}

Extensões:

  • vscode-icons
  • markdown all in one
  • editorconfig