-
Notifications
You must be signed in to change notification settings - Fork 0
/
.darwin
54 lines (44 loc) · 1.46 KB
/
.darwin
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# shellcheck disable=SC2206
# Allow adding cronjobs with Vim.
#
# @see: https://superuser.com/a/750528
alias crontab="export VIM_CRONTAB=true; /usr/bin/crontab"
alias ls='gls --color=tty --group-directories-first'
# Erase the clipboard.
alias pbd="pbcopy </dev/null"
# Quick computer lock command.
alias afk="open -a /System/Library/Frameworks/ScreenSaver.framework/ Versions/A/Resources/ScreenSaverEngine.app"
export HOMEBREW_CASK_OPTS="--appdir=/Applications"
# Set `open` tool as default `BROWSER` on macOS.
export BROWSER='open'
# Homebrew update, upgrade, cleanup, doctor.
function bs() {
# shellcheck disable=SC2155
local LOGFILE="/tmp/brewlog-$(/bin/date -j '+%Y%m%d')"
# shellcheck disable=SC1117
local YELLOW="\033[1;33m"
# shellcheck disable=SC1117
local NC="\033[0m"
echo "${YELLOW}LOGFILE:${NC} $LOGFILE" | tee -a "$LOGFILE"
for command in tap upgrade "cask upgrade --greedy" "cleanup --verbose" doctor; do
# shellcheck disable=SC1117,SC2028
echo "\n${YELLOW}COMMAND:${NC} ${command}\n" | tee -a "$LOGFILE"
eval "brew ${command}" 2>&1 |
tee -a "$LOGFILE"
done
}
# Open Drupal project webpage.
function dp() {
open "https://www.drupal.org/project/${1}"
}
# Remove line number from file.
function rml() {
local FILE=${2:-"${HOME}/.ssh/known_hosts"}
local LINE=$1
gsed -i -e "${LINE}d" "${FILE}"
}
# Set the list of directories that Zsh searches for programs.
path=(
/usr/local/opt/git/share/git-core/contrib/diff-highlight
$path
)