Skip to content

Commit acd701e

Browse files
committed
Merge mathiasbynens/dotfiles into nick
* upstream/main: .gitconfig: delete `mpr` alias .gitconfig: show most recent branches first meta: rename main branch .gitconfig: make `git init` default to `main` instead of `master` (mathiasbynens#926) .gitconfig: improve `git p` alias (mathiasbynens#896) .exports: Hide zsh warning on macOS .macos: fix showing ~/Library folder in macOS 10.15 (Catalina) (mathiasbynens#917) .gitconfig: Add `g whoami` README: Fix link (mathiasbynens#902) .bash_prompt: Exit early for Chromium/Blink repo .macos: Also disable Java for local domains in Safari (mathiasbynens#769) .macos: Consolidate energy management settings .gitconfig: Simplify `git p` alias .macos: Add Hot Corner option for Lock Screen (13) .macos: Replace `Flwv` with `glyv` (mathiasbynens#886) .aliases: Make `mergepdf` preserve hyperlinks
2 parents 5e86013 + 9eecaba commit acd701e

File tree

8 files changed

+49
-51
lines changed

8 files changed

+49
-51
lines changed

.aliases

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ alias showdesktop="defaults write com.apple.finder CreateDesktop -bool true && k
105105
# URL-encode strings
106106
alias urlencode='python -c "import sys, urllib as ul; print ul.quote_plus(sys.argv[1]);"'
107107

108-
# Merge PDF files
109-
# Usage: `mergepdf -o output.pdf input{1,2,3}.pdf`
110-
alias mergepdf='/System/Library/Automator/Combine\ PDF\ Pages.action/Contents/Resources/join.py'
108+
# Merge PDF files, preserving hyperlinks
109+
# Usage: `mergepdf input{1,2,3}.pdf`
110+
alias mergepdf='gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=_merged.pdf'
111111

112112
# Disable Spotlight
113113
alias spotoff="sudo mdutil -a -i off"
@@ -130,9 +130,6 @@ for method in GET HEAD POST PUT DELETE TRACE OPTIONS; do
130130
alias "${method}"="lwp-request -m '${method}'"
131131
done
132132

133-
# Make Grunt print stack traces by default
134-
command -v grunt > /dev/null && alias grunt="grunt --stack"
135-
136133
# Stuff I never really use but cannot delete either because of http://xkcd.com/530/
137134
alias stfu="osascript -e 'set volume output muted true'"
138135
alias pumpitup="osascript -e 'set volume output volume 100'"

.config/git/template/HEAD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ref: refs/heads/main

.exports

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,6 @@ export GOPATH=$HOME/.go
4343
# No thanks, homebrew -- please dom't cleanup after me
4444
# https://brew.sh/2019/02/02/homebrew-2.0.0
4545
export HOMEBREW_NO_INSTALL_CLEANUP=1
46+
47+
# Hide the “default interactive shell is now zsh” warning on macOS.
48+
export BASH_SILENCE_DEPRECATION_WARNING=1;

.gitconfig

Lines changed: 35 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
11
[alias]
22

3-
# View abbreviated SHA, description, and history graph of the latest 20 commits
3+
# View abbreviated SHA, description, and history graph of the latest 20 commits.
44
l = log --pretty=oneline -n 20 --graph --abbrev-commit
55

6-
# View the current working tree status using the short format
6+
# View the current working tree status using the short format.
77
s = status -s
88

9-
# Show the diff between the latest commit and the current state
9+
# Show the diff between the latest commit and the current state.
1010
d = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat"
1111

12-
# `git di $number` shows the diff between the state `$number` revisions ago and the current state
12+
# `git di $number` shows the diff between the state `$number` revisions ago and the current state.
1313
di = !"d() { git diff --patch-with-stat HEAD~$1; }; git diff-index --quiet HEAD -- || clear; d"
1414

15-
# Pull in remote changes for the current repository and all its submodules
16-
p = !"git pull; git submodule foreach git pull origin master"
15+
# Pull in remote changes for the current repository and all its submodules.
16+
p = pull --recurse-submodules
1717

18-
# Clone a repository including all submodules
18+
# Clone a repository including all submodules.
1919
c = clone --recursive
2020

21-
# Commit all changes
21+
# Commit all changes.
2222
ca = !git add -A && git commit -av
2323

24-
# Switch to a branch, creating it if necessary
24+
# Switch to a branch, creating it if necessary.
2525
go = "!f() { git checkout -b \"$1\" 2> /dev/null || git checkout \"$1\"; }; f"
2626

2727
# Show verbose output about tags, branches or remotes
2828
tags = tag -l
29-
branches = branch -a
30-
remotes = remote -v
29+
branches = branch --all
30+
remotes = remote --verbose
3131

32-
# List aliases
32+
# List aliases.
3333
aliases = config --get-regexp alias
3434

35-
# Amend the currently staged files to the latest commit
35+
# Amend the currently staged files to the latest commit.
3636
amend = commit --amend --reuse-message=HEAD
3737

38-
# Credit an author on the latest commit
38+
# Credit an author on the latest commit.
3939
credit = "!f() { git commit --amend --author \"$1 <$2>\" -C HEAD; }; f"
4040

41-
# Interactive rebase with the given number of latest commits
41+
# Interactive rebase with the given number of latest commits.
4242
reb = "!r() { git rebase -i HEAD~$1; }; r"
4343

4444
# Remove the old tag with this name and tag the latest commit with it.
@@ -56,28 +56,15 @@
5656
# Find commits by commit message
5757
fm = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short --grep=$1; }; f"
5858

59-
# Remove branches that have already been merged with master
59+
# Remove branches that have already been merged with main.
6060
# a.k.a. ‘delete merged’
6161
dm = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"
6262

63-
# List contributors with number of commits
63+
# List contributors with number of commits.
6464
contributors = shortlog --summary --numbered
6565

66-
# Merge GitHub pull request on top of the current branch or,
67-
# if a branch name is specified, on top of the specified branch
68-
mpr = "!f() { \
69-
declare currentBranch=\"$(git symbolic-ref --short HEAD)\"; \
70-
declare branch=\"${2:-$currentBranch}\"; \
71-
if [ $(printf \"%s\" \"$1\" | grep '^[0-9]\\+$' > /dev/null; printf $?) -eq 0 ]; then \
72-
git fetch origin refs/pull/$1/head:pr/$1 && \
73-
git checkout -B $branch && \
74-
git rebase $branch pr/$1 && \
75-
git checkout -B $branch && \
76-
git merge pr/$1 && \
77-
git branch -D pr/$1 && \
78-
git commit --amend -m \"$(git log -1 --pretty=%B)\n\nCloses #$1.\"; \
79-
fi \
80-
}; f"
66+
# Show the user email for the current repository.
67+
whoami = config user.email
8168

8269
# Old faithful - single line, abbreviated SHA & color
8370
logger = log --oneline --decorate
@@ -105,21 +92,26 @@
10592

10693
[apply]
10794

108-
# Detect whitespace errors when applying a patch
95+
# Detect whitespace errors when applying a patch.
10996
whitespace = fix
11097

98+
[branch]
99+
100+
# Show most recently changed branches first.
101+
sort = -committerdate
102+
111103
[core]
112104

113-
# Use custom `.gitignore` and `.gitattributes`
105+
# Use custom `.gitignore` and `.gitattributes`.
114106
excludesfile = ~/.gitignore
115107
attributesfile = ~/.gitattributes
116108

117-
# Treat spaces before tabs and all kinds of trailing whitespace as an error
109+
# Treat spaces before tabs and all kinds of trailing whitespace as an error.
118110
# [default] trailing-space: looks for spaces at the end of a line
119111
# [default] space-before-tab: looks for spaces before tabs at the beginning of a line
120112
whitespace = space-before-tab,-indent-with-non-tab,trailing-space
121113

122-
# Make `git rebase` safer on macOS
114+
# Make `git rebase` safer on macOS.
123115
# More info: <http://www.git-tower.com/blog/make-git-rebase-safe-on-osx/>
124116
trustctime = false
125117

@@ -166,17 +158,17 @@
166158

167159
[diff]
168160

169-
# Detect copies as well as renames
161+
# Detect copies as well as renames.
170162
renames = copies
171163

172164
[diff "bin"]
173165

174-
# Use `hexdump` to diff binary files
166+
# Use `hexdump` to diff binary files.
175167
textconv = hexdump -v -C
176168

177169
[help]
178170

179-
# Automatically correct and execute mistyped commands
171+
# Automatically correct and execute mistyped commands.
180172
autocorrect = 1
181173

182174
[merge]
@@ -212,3 +204,7 @@
212204
[url "git://gist.github.com/"]
213205

214206
insteadOf = "gist:"
207+
208+
[init]
209+
210+
templateDir = ~/.config/git/template/

.macos

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
164164
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:iconSize 80" $HOME/Library/Preferences/com.apple.finder.plist
165165

166166
# Use list view in all Finder windows by default
167-
# Four-letter codes for the other view modes: `icnv`, `clmv`, `Flwv`
167+
# Four-letter codes for the other view modes: `icnv`, `clmv`, `glyv`
168168
defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"
169169

170170
# Disable the warning before emptying the Trash
@@ -174,7 +174,7 @@ defaults write com.apple.finder WarnOnEmptyTrash -bool false
174174
defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true
175175

176176
# Show the ~/Library folder
177-
chflags nohidden $HOME/Library
177+
chflags nohidden ~/Library && xattr -d com.apple.FinderInfo ~/Library
178178

179179
# Expand the following File Info panes:
180180
# “General”, “Open with”, and “Sharing & Permissions”
@@ -253,6 +253,7 @@ sudo ln -sf "/Applications/Xcode.app/Contents/Developer/Applications/Simulator (
253253
# 10: Put display to sleep
254254
# 11: Launchpad
255255
# 12: Notification Center
256+
# 13: Lock Screen
256257
# Top left screen corner → Mission Control
257258
defaults write com.apple.dock wvous-tl-corner -int 2
258259
defaults write com.apple.dock wvous-tl-modifier -int 0

.osx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
# 301 https://github.com/mathiasbynens/dotfiles/blob/master/.macos
1+
# 301 https://github.com/mathiasbynens/dotfiles/blob/main/.macos

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ set -- -f; source bootstrap.sh
3333
To install these dotfiles without Git:
3434

3535
```bash
36-
cd; curl -#L https://github.com/mathiasbynens/dotfiles/tarball/master | tar -xzv --strip-components 1 --exclude={README.md,bootstrap.sh,.osx,LICENSE-MIT.txt}
36+
cd; curl -#L https://github.com/mathiasbynens/dotfiles/tarball/main | tar -xzv --strip-components 1 --exclude={README.md,bootstrap.sh,.osx,LICENSE-MIT.txt}
3737
```
3838

3939
To update later on, just run that command again.
4040

4141
### Specify the `$PATH`
4242

43-
If `~/.path` exists, it will be sourced along with the other files, before any feature testing (such as [detecting which version of `ls` is being used](https://github.com/mathiasbynens/dotfiles/blob/aff769fd75225d8f2e481185a71d5e05b76002dc/.aliases#L21-26)) takes place.
43+
If `~/.path` exists, it will be sourced along with the other files, before any feature testing (such as [detecting which version of `ls` is being used](https://github.com/mathiasbynens/dotfiles/blob/aff769fd75225d8f2e481185a71d5e05b76002dc/.aliases#L21-L26)) takes place.
4444

4545
Here’s an example `~/.path` file that adds `/usr/local/bin` to the `$PATH`:
4646

bootstrap.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
cd "$(dirname "${BASH_SOURCE}")";
44

5-
git pull origin master;
5+
git pull origin main;
66

77
function doIt() {
88
rsync --exclude ".git/" \

0 commit comments

Comments
 (0)