Monday, 14 January 2013

After stumbling across this collection of OS X tweaks, I thought I’d write down the ones that I find useful (plus a few extras).

# Enable full keyboard access for all controls
# (e.g. enable Tab in modal dialogs)
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3

# Disable the warning when changing a file extension
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false

# Show the ~/Library folder
chflags nohidden ~/Library

# Don’t show Dashboard as a Space
defaults write com.apple.dock "dashboard-in-overlay" -bool true

# Finder: allow text selection in Quick Look
defaults write com.apple.finder QLEnableTextSelection -bool true

# QLColorCode: change font to Menlo
defaults write org.n8gray.QLColorCode font Menlo

# QLColorCode: change font size to 8
defaults write org.n8gray.QLColorCode fontSizePoints 8

# QLColorCode: display line numbers
defaults write org.n8gray.QLColorCode extraHLFlags '-l'

Here’s an interesting custom bash prompt with git repo and branch:

export PS1="\n\e[0;37m\$(git remote -v 2>/dev/null | grep -e '^origin.*(fetch)' | sed 's/^.*[/,:]\(.*\)\.git.*/\1:/') \$(git branch 2>/dev/null | grep -e '\* ' | sed 's/^..\(.*\)/\1 /')\w\e[00m\n\$ "

(P.S. Now I know how to use sed!)