-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshenv
66 lines (50 loc) · 2.35 KB
/
.zshenv
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
55
56
57
58
59
60
61
62
63
64
65
# PATH
export PATH="/usr/local/bin:$HOME/bin:$HOME/.local/bin:$HOME/.emacs.d/bin:$PATH"
# Language environment
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
# Use vim as default editor
export VISUAL=nvim
export EDITOR="$VISUAL"
# Use libc++ (llvm) from brew
## /usr/local/opt/llvm = brew --prefix llvm
## I'm using a hardcoded value here to speed up shell start
export LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib"
export CPPFLAGS="-I/usr/local/opt/llvm/include"
export CFLAGS="-I/usr/local/opt/llvm/include"
# Add OpenSSL PKG_CONFIG path (required by Crystal's Lucky framework)
export PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig
# GPG
export GPG_TTY=$(tty)
# Setup lesspipe for better less for binary files
export LESSOPEN="|/usr/local/bin/lesspipe.sh %s" LESS_ADVANCED_PREPROCESSOR=1
# Homebrew
## I'm using hardcoded value to speed up shell start
export HOMEBREW_PREFIX="/usr/local"
# FZF
## Show certain number of lines in preview window
export FZF_PREVIEW_LINES=1000
## Use fd for rast dir/path traversal
export FZF_DEFAULT_COMMAND="/usr/local/bin/fd --hidden --no-ignore '' 2>/dev/null"
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_ALT_C_COMMAND="/usr/local/bin/fd --hidden --no-ignore --type d '' 2>/dev/null"
## Preview dir tree on alt-c
export FZF_ALT_C_OPTS="--no-height --preview 'tree -C {} | head -'$FZF_PREVIEW_LINES"
## Press ? to toggle preview for too long commands
export FZF_CTRL_R_OPTS="--preview 'echo {}' --preview-window down:3:hidden:wrap --bind '?:toggle-preview'"
## Preview files with syntax highlight on ctrl-t
export FZF_CTRL_T_OPTS="--no-height
--bind 'ctrl-y:execute-silent(echo {} | pbcopy)+abort'
--preview 'file --mime {} | grep \"binary\" | grep -qv \"directory\" &&
echo {} is a binary file ||
(bat {} --color=always ||
cat {} ||
tree -C {}) 2> /dev/null | head -'$FZF_PREVIEW_LINES"
# Usage in scripts: eval $DEBUGGER
export DEBUGGER='while IFS="\n" read -erp "[$(basename ${BASH_SOURCE[0]}):$LINENO]> " command_to_execute; do
eval "$command_to_execute";
done;
echo'
# Enable history in iex
export ERL_AFLAGS="-kernel shell_history enabled"
source ~/.secrets