-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshenv
86 lines (75 loc) · 2.53 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# usage: pathmunge $path [after]
pathmunge()
{
if ! echo $PATH | grep -qE "(^|:)$1($|:)" ; then
if [ "$2" = "after" ] ; then
PATH=$PATH:$1
else
PATH=$1:$PATH
fi
fi
}
# aliases
alias jf='wd'
alias nv='nvim'
alias eza='eza --group-directories-first'
alias path='echo $PATH | tr ":" "\n" | uniq'
alias xclip='xclip -sel clip'
alias pgrep='pgrep -l'
alias pbcopy='xclip -i'
alias pbpaste='xclip -o'
alias rm='echo "Please use trash-cli instead!"; false'
alias dot='/usr/bin/git --git-dir=$HOME/.dotfiles.git/ --work-tree=$HOME'
# env_vars
export VISUAL=vim
export EDITOR=vim
export JAVA_HOME=/snap/openjdk/current/jdk
export BOOST_ROOT=$HOME/libs/boost
export FLUTTER_ROOT=$HOME/tools/flutter
export ANDROID_HOME=$HOME/tools/android/sdk
export ANDROID_SDK_ROOT=$ANDROID_HOME
export CHROME_EXECUTABLE=/snap/bin/chromium
FD_TOOL="fd"
FD_OPTIONS="--hidden --follow --exclude .git --exclude node_modules"
export FZF_DEFAULT_COMMAND="git ls-files --cached --others --exclude-standard 2>/dev/null || ${FD_TOOL} ${FD_OPTIONS} --type f --type l"
export FZF_DEFAULT_OPTS="\
--no-mouse \
--no-scrollbar \
--multi \
--cycle \
--reverse \
--marker=+ \
--height=80% \
--border=none \
--info=inline \
--preview='if [ -d {} ]; then eza --color always -T -L 2 {}; elif [ -f {} ]; then bat -f --style=numbers {}; fi' \
--preview-window='right:60%:wrap,<50(bottom,50%)' \
--history='$HOME/.fzf_history' --history-size=50 \
--bind='f3:execute(if [ -f {} ]; then bat --style=numbers {} || less -f {}; fi)'
--bind='f4:execute($EDITOR {})' \
--bind='alt-w:toggle-preview-wrap' \
--bind='ctrl-d:half-page-down' \
--bind='ctrl-u:half-page-up' \
--bind='ctrl-x:execute(rm -i {+})+abort' \
--bind='ctrl-l:clear-query+first' \
--bind='ctrl-y:execute-silent(echo {+} | pbcopy)+abort' \
--bind='ctrl-\:change-preview-window(hidden|bottom,50%|right:60%)'"
#export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
#export FZF_CTRL_T_OPTS=""
export FZF_CTRL_R_OPTS=" \
--height=60% \
--with-nth='2..' \
--preview='echo {2..}' \
--preview-window='bottom:3:wrap:border-top,<50(bottom:3:wrap:border-top)' \
--bind='change:first' \
--bind='ctrl-y:execute-silent(echo -n {2..} | pbcopy)+abort'"
export FZF_ALT_C_COMMAND="${FD_TOOL} ${FD_OPTIONS} --type d"
# PATH
pathmunge $HOME/.local/bin
pathmunge $HOME/.cargo/bin
pathmunge $HOME/.pub-cache/bin
pathmunge $HOME/tools/flutter/bin
pathmunge $JAVA_HOME/bin
pathmunge $ANDROID_HOME/cmdline-tools/latest/bin
pathmunge $ANDROID_HOME/platform-tools
unset -f pathmunge