/
config.fish
95 lines (74 loc) · 2.68 KB
/
config.fish
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
86
87
88
89
90
91
92
93
94
95
# in .config/fish/config.fish:
# Fish git prompt
set __fish_git_prompt_showdirtystate 'yes'
set __fish_git_prompt_showstashstate 'yes'
set __fish_git_prompt_showupstream 'yes'
set __fish_git_prompt_color_branch yellow
# Status Chars
set __fish_git_prompt_char_dirtystate '⚡'
set __fish_git_prompt_char_stagedstate '→'
set __fish_git_prompt_char_stashstate '↩'
set __fish_git_prompt_char_upstream_ahead '↑'
set __fish_git_prompt_char_upstream_behind '↓'
function fish_prompt
set last_status $status
set_color $fish_color_cwd
printf '%s' (prompt_pwd)
set_color normal
printf '%s ' (__fish_git_prompt)
set_color normal
end
function list-java
lsof -a -d cwd -c java
end
function list-ports
lsof -iTCP -sTCP:LISTEN -P
end
# Disable sleep on Mac temporarily. Runs in foreground. Ctrl-C to cancel.
function mac-no-sleep
# On older Mac's, use pmset noidle... but caffeinate works better on newer Macs
caffeinate
end
function refresh-calendar-agent
launchctl stop com.apple.CalendarAgent
launchctl start com.apple.CalendarAgent
end
eval (/opt/homebrew/bin/brew shellenv)
set -gx PATH "$HOME/.cargo/bin" $PATH
zoxide init fish | source
alias subl3="'/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl'"
alias rclip="cargo clippy --all --tests -- -D clippy::all -D warnings -D clippy::disallowed_method"
# Environment vars
# NOTE: below is for JDK 8
set -x SBT_OPTS "-XX:+CMSClassUnloadingEnabled -Xmx5g -XX:MaxMetaspaceSize=512m"
# relies on setting up host-only networking with static IP in Linux VM
# set -x DOCKER_HOST tcp://192.168.56.10:2375
set -x EDITOR /usr/bin/vim
set -x JAVA_HOME (jenv javahome)
set -x ASYNC_PROFILER_DIR "$HOME/src/github/async-profiler"
set -x FLAME_GRAPH_DIR "$HOME/src/github/FlameGraph"
# Helps performance of standard OSX Malloc for CLI apps
set -x MallocNanoZone 1
# set -x DYLD_LIBRARY_PATH $DYLD_LIBRARY_PATH /usr/local/lib/rustlib/x86_64-apple-darwin/lib/
set PATH ~/bin $PATH
# for jenv
status --is-interactive; and jenv init - | source
# rbenv support
# set PATH $HOME/.rbenv/bin $PATH
# set PATH $HOME/.rbenv/shims $PATH
# rbenv rehash >/dev/null ^&1
set -gx RBENV_ROOT /usr/local/Cellar/rbenv/0.4.0
# . (rbenv init -|psub)
# status --is-interactive; and source (rbenv init -|psub)
# Python set
if command -v pyenv 1>/dev/null 2>&1
pyenv init - | source
end
status --is-interactive; and pyenv virtualenv-init - | source
set -Ux PYENV_ROOT $HOME/.pyenv
set -Ux fish_user_paths $PYENV_ROOT/bin $fish_user_paths
# Aliases
alias git=hub
alias subl3="'/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl'"
alias java8="set -x JAVA_HOME /Users/evan/.jenv/versions/1.8"
alias java11="set -x JAVA_HOME /Users/evan/.jenv/versions/11.0"