-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustom.zsh
62 lines (57 loc) · 1.58 KB
/
custom.zsh
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
alias vim="nvim"
export EDITOR="nvim"
export LC_ALL=C.UTF-8 # for Hyper tests to work
export LANG=en_US.utf-8
case "$USER" in
caravan)
export DATA='~/volume'
;;
*)
export DATA='~'
;;
esac
case `uname` in
Darwin)
# commands for OS X go here
export MAKEFLAGS="-j $(sysctl -n hw.ncpu)"
export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git'
;;
Linux)
# commands for Linux go here
alias fd=fdfind
export MAKEFLAGS="-j $(nproc)"
export FZF_DEFAULT_COMMAND='fdfind --type f --hidden --follow --exclude .git'
alias cppmake='~/Programs/cppmake/bin/cppmake'
alias open='gio open'
export LINKER=lld
if [ -d "$HOME/.local/bin" ] ; then
PATH="$PATH:$HOME/.local/bin"
fi
alias idea='/home/j.boettcher/Programs/idea-IC-223.7571.182/bin/idea.sh'
export ASAN_OPTIONS=detect_container_overflow=0
;;
FreeBSD)
# commands for FreeBSD go here
;;
esac
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# CTRL-O: find bazel target with fzf
__target_sel() {
local cmd="./bzl.py query '//...' 2> /dev/null"
setopt localoptions pipefail no_aliases 2> /dev/null
local item
eval "$cmd" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse --bind=ctrl-z:ignore $FZF_DEFAULT_OPTS $FZF_CTRL_T_OPTS" $(__fzfcmd) -m "$@" | while read item; do
echo -n "${(q)item} "
done
local ret=$?
echo
return $ret
}
fzf-bazel-widget() {
LBUFFER="${LBUFFER}$(__target_sel)"
local ret=$?
zle reset-prompt
return $ret
}
zle -N fzf-bazel-widget
bindkey '^o' fzf-bazel-widget