Skip to content

Commit 3b4eb3e

Browse files
committed
Remove some things that I don’t use
This commit drops some aliases, functions, and settings from the project that I wasn’t using at all. It also cleans up some of the remaining code.
1 parent e030845 commit 3b4eb3e

9 files changed

+218
-257
lines changed

.aliases

+5-12
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ export LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40
3838
# Enable aliases to be sudo’ed
3939
alias sudo='sudo '
4040

41-
# Gzip-enabled `curl`
42-
alias gurl='curl --compressed'
43-
4441
# Get week number
4542
alias week='date +%V'
4643

@@ -78,19 +75,16 @@ command -v md5sum > /dev/null || alias md5sum="md5"
7875
command -v sha1sum > /dev/null || alias sha1sum="shasum"
7976

8077
# JavaScriptCore REPL
81-
jscbin="/System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc"
82-
[ -e "${jscbin}" ] && alias jsc="${jscbin}"
83-
unset jscbin
78+
jscbin="/System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc";
79+
[ -e "${jscbin}" ] && alias jsc="${jscbin}";
80+
unset jscbin;
8481

8582
# Trim new lines and copy to clipboard
8683
alias c="tr -d '\n' | pbcopy"
8784

8885
# Recursively delete `.DS_Store` files
8986
alias cleanup="find . -type f -name '*.DS_Store' -ls -delete"
9087

91-
# ROT13-encode text. Works for decoding, too! ;)
92-
alias rot13='tr a-zA-Z n-za-mN-ZA-M'
93-
9488
# Empty the Trash on all mounted volumes and the main HDD
9589
# Also, clear Apple’s System Logs to improve shell startup speed
9690
alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl"
@@ -138,7 +132,6 @@ command -v grunt > /dev/null && alias grunt="grunt --stack"
138132
# Stuff I never really use but cannot delete either because of http://xkcd.com/530/
139133
alias stfu="osascript -e 'set volume output muted true'"
140134
alias pumpitup="osascript -e 'set volume 7'"
141-
alias hax="growlnotify -a 'Activity Monitor' 'System error' -m 'WTF R U DOIN'"
142135

143136
# Kill all the tabs in Chrome to free up memory
144137
# [C] explained: http://www.commandlinefu.com/commands/view/402/exclude-grep-from-your-grepped-output-of-ps-alias-included-in-description
@@ -150,5 +143,5 @@ alias afk="/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resource
150143
# Reload the shell (i.e. invoke as a login shell)
151144
alias reload="exec $SHELL -l"
152145

153-
# Faster npm for europeans
154-
command -v npm > /dev/null && alias npme="npm --registry http://registry.npmjs.eu"
146+
# Faster npm for Europeans
147+
command -v npm > /dev/null && alias npme="npm --registry http://registry.npmjs.eu/"

.bash_profile

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,46 @@
11
# Add `~/bin` to the `$PATH`
2-
export PATH="$HOME/bin:$PATH"
2+
export PATH="$HOME/bin:$PATH";
33

44
# Load the shell dotfiles, and then some:
55
# * ~/.path can be used to extend `$PATH`.
66
# * ~/.extra can be used for other settings you don’t want to commit.
77
for file in ~/.{path,bash_prompt,exports,aliases,functions,extra}; do
8-
[ -r "$file" ] && [ -f "$file" ] && source "$file"
9-
done
10-
unset file
8+
[ -r "$file" ] && [ -f "$file" ] && source "$file";
9+
done;
10+
unset file;
1111

1212
# Case-insensitive globbing (used in pathname expansion)
13-
shopt -s nocaseglob
13+
shopt -s nocaseglob;
1414

1515
# Append to the Bash history file, rather than overwriting it
16-
shopt -s histappend
16+
shopt -s histappend;
1717

1818
# Autocorrect typos in path names when using `cd`
19-
shopt -s cdspell
19+
shopt -s cdspell;
2020

2121
# Enable some Bash 4 features when possible:
2222
# * `autocd`, e.g. `**/qux` will enter `./foo/bar/baz/qux`
2323
# * Recursive globbing, e.g. `echo **/*.txt`
2424
for option in autocd globstar; do
25-
shopt -s "$option" 2> /dev/null
26-
done
25+
shopt -s "$option" 2> /dev/null;
26+
done;
2727

2828
# Add tab completion for many Bash commands
2929
if which brew > /dev/null && [ -f "$(brew --prefix)/etc/bash_completion" ]; then
30-
source "$(brew --prefix)/etc/bash_completion"
31-
fi
30+
source "$(brew --prefix)/etc/bash_completion";
31+
fi;
3232

3333
# Enable tab completion for `g` by marking it as an alias for `git`
3434
if type _git &> /dev/null && [ -f /usr/local/etc/bash_completion.d/git-completion.bash ]; then
35-
complete -o default -o nospace -F _git g
36-
fi
35+
complete -o default -o nospace -F _git g;
36+
fi;
3737

3838
# Add tab completion for SSH hostnames based on ~/.ssh/config, ignoring wildcards
39-
[ -e "$HOME/.ssh/config" ] && complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2 | tr ' ' '\n')" scp sftp ssh
39+
[ -e "$HOME/.ssh/config" ] && complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2 | tr ' ' '\n')" scp sftp ssh;
4040

4141
# Add tab completion for `defaults read|write NSGlobalDomain`
4242
# You could just use `-g` instead, but I like being explicit
43-
complete -W "NSGlobalDomain" defaults
43+
complete -W "NSGlobalDomain" defaults;
4444

4545
# Add `killall` tab completion for common apps
46-
complete -o "nospace" -W "Contacts Calendar Dock Finder Mail Safari iTunes SystemUIServer Terminal Twitter" killall
46+
complete -o "nospace" -W "Contacts Calendar Dock Finder Mail Safari iTunes SystemUIServer Terminal Twitter" killall;

.bash_prompt

+39-39
Original file line numberDiff line numberDiff line change
@@ -3,55 +3,55 @@
33
# Screenshot: http://i.imgur.com/s0Blh.png
44

55
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then
6-
export TERM=gnome-256color
6+
export TERM=gnome-256color;
77
elif infocmp xterm-256color >/dev/null 2>&1; then
8-
export TERM=xterm-256color
8+
export TERM=xterm-256color;
99
fi
1010

1111
if tput setaf 1 &> /dev/null; then
12-
tput sgr0
12+
tput sgr0; # reset colors
1313
if [[ $(tput colors) -ge 256 ]] 2>/dev/null; then
14-
MAGENTA=$(tput setaf 9)
15-
ORANGE=$(tput setaf 172)
16-
GREEN=$(tput setaf 190)
17-
PURPLE=$(tput setaf 141)
18-
WHITE=$(tput setaf 0)
14+
MAGENTA=$(tput setaf 9);
15+
ORANGE=$(tput setaf 172);
16+
GREEN=$(tput setaf 190);
17+
PURPLE=$(tput setaf 141);
18+
WHITE=$(tput setaf 0);
1919
else
20-
MAGENTA=$(tput setaf 5)
21-
ORANGE=$(tput setaf 4)
22-
GREEN=$(tput setaf 2)
23-
PURPLE=$(tput setaf 1)
24-
WHITE=$(tput setaf 7)
25-
fi
26-
BOLD=$(tput bold)
27-
RESET=$(tput sgr0)
20+
MAGENTA=$(tput setaf 5);
21+
ORANGE=$(tput setaf 4);
22+
GREEN=$(tput setaf 2);
23+
PURPLE=$(tput setaf 1);
24+
WHITE=$(tput setaf 7);
25+
fi;
26+
BOLD=$(tput bold);
27+
RESET=$(tput sgr0);
2828
else
29-
MAGENTA="\033[1;31m"
30-
ORANGE="\033[1;33m"
31-
GREEN="\033[1;32m"
32-
PURPLE="\033[1;35m"
33-
WHITE="\033[1;37m"
34-
BOLD=""
35-
RESET="\033[m"
36-
fi
29+
MAGENTA="\033[1;31m";
30+
ORANGE="\033[1;33m";
31+
GREEN="\033[1;32m";
32+
PURPLE="\033[1;35m";
33+
WHITE="\033[1;37m";
34+
BOLD="";
35+
RESET="\033[m";
36+
fi;
3737

38-
export MAGENTA
39-
export ORANGE
40-
export GREEN
41-
export PURPLE
42-
export WHITE
43-
export BOLD
44-
export RESET
38+
export MAGENTA;
39+
export ORANGE;
40+
export GREEN;
41+
export PURPLE;
42+
export WHITE;
43+
export BOLD;
44+
export RESET;
4545

4646
function parse_git_branch() {
47-
local branch=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
47+
local branch=$(git rev-parse --abbrev-ref HEAD 2>/dev/null);
4848
if [ -n "${branch}" ]; then
49-
[ "${branch}" == "HEAD" ] && local branch=$(git rev-parse --short HEAD 2>/dev/null)
50-
local status=$(git status --porcelain 2>/dev/null)
51-
echo -n " on ${PURPLE}${branch}"
52-
[ -n "${status}" ] && echo -n "*"
53-
fi
49+
[ "${branch}" == "HEAD" ] && local branch=$(git rev-parse --short HEAD 2>/dev/null);
50+
local status=$(git status --porcelain 2>/dev/null);
51+
echo -n " on ${PURPLE}${branch}";
52+
[ -n "${status}" ] && echo -n "*";
53+
fi;
5454
}
5555

56-
export PS1="\[${BOLD}${MAGENTA}\]\u \[$WHITE\]at \[$ORANGE\]\h \[$WHITE\]in \[$GREEN\]\w\[$WHITE\]\$(parse_git_branch)\[$WHITE\]\n\$ \[$RESET\]"
57-
export PS2="\[$ORANGE\]→ \[$RESET\]"
56+
export PS1="\[${BOLD}${MAGENTA}\]\u \[$WHITE\]at \[$ORANGE\]\h \[$WHITE\]in \[$GREEN\]\w\[$WHITE\]\$(parse_git_branch)\[$WHITE\]\n\$ \[$RESET\]";
57+
export PS2="\[$ORANGE\]→ \[$RESET\]";

.bashrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[ -n "$PS1" ] && source ~/.bash_profile
1+
[ -n "$PS1" ] && source ~/.bash_profile;

.exports

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
# Make vim the default editor
2-
export EDITOR="vim"
2+
export EDITOR="vim";
33

44
# Larger bash history (allow 32³ entries; default is 500)
5-
export HISTSIZE=32768
6-
export HISTFILESIZE=$HISTSIZE
7-
export HISTCONTROL=ignoredups
5+
export HISTSIZE=32768;
6+
export HISTFILESIZE=$HISTSIZE;
7+
export HISTCONTROL=ignoredups;
88
# Make some commands not show up in history
9-
export HISTIGNORE="ls:cd:cd -:pwd:exit:date:* --help"
9+
export HISTIGNORE="ls:cd:cd -:pwd:exit:date:* --help";
1010

1111
# Prefer US English and use UTF-8
12-
export LANG="en_US.UTF-8"
13-
export LC_ALL="en_US.UTF-8"
12+
export LANG="en_US.UTF-8";
13+
export LC_ALL="en_US.UTF-8";
1414

1515
# Highlight section titles in manual pages
16-
export LESS_TERMCAP_md="$ORANGE"
16+
export LESS_TERMCAP_md="${ORANGE}";
1717

1818
# Don’t clear the screen after quitting a manual page
19-
export MANPAGER="less -X"
19+
export MANPAGER="less -X";
2020

2121
# Always enable colored `grep` output
22-
export GREP_OPTIONS="--color=auto"
22+
export GREP_OPTIONS="--color=auto";
2323

2424
# Link Homebrew casks in `/Applications` rather than `~/Applications`
25-
export HOMEBREW_CASK_OPTS="--appdir=/Applications"
25+
export HOMEBREW_CASK_OPTS="--appdir=/Applications";

0 commit comments

Comments
 (0)