Skip to content

Commit

Permalink
perf: speed up
Browse files Browse the repository at this point in the history
- Lazy load `jenv`, which is causing the most slowdown: jenv/jenv#148 (comment)
- Remove duplicate cw load
- Remove fzf
  • Loading branch information
aboqasem committed Mar 17, 2024
1 parent aaf7939 commit 3f4034c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
13 changes: 13 additions & 0 deletions custom/functions.zsh
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
#!/usr/bin/env zsh

lazy_jenv() {
unset -f java jenv
eval "$(jenv init -)"
}
jenv() {
lazy_jenv
jenv $@
}
java() {
lazy_jenv
java $@
}

# Create a new directory and enter it
function mkd() {
mkdir -p "$@" && cd "$_" || exit
Expand Down
12 changes: 0 additions & 12 deletions custom/profile.zsh
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/usr/bin/env zsh

# CodeWhisperer pre block. Keep at the top of this file.
[[ -f "${HOME}/Library/Application Support/codewhisperer/shell/zshrc.pre.zsh" ]] && builtin source "${HOME}/Library/Application Support/codewhisperer/shell/zshrc.pre.zsh"

# Homebrew completions
fpath+=~/.zfunc
if type brew &>/dev/null; then
Expand All @@ -12,17 +9,8 @@ if type brew &>/dev/null; then
compinit
fi

# fzf init
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh

# jenv init
eval "$(jenv init -)"

# atuin init
eval "$(atuin init zsh --disable-up-arrow)"

# bun completions
[ -s "$HOME/.bun/_bun" ] && source "$HOME/.bun/_bun"

# CodeWhisperer post block. Keep at the bottom of this file.
[[ -f "${HOME}/Library/Application Support/codewhisperer/shell/zshrc.post.zsh" ]] && builtin source "${HOME}/Library/Application Support/codewhisperer/shell/zshrc.post.zsh"

0 comments on commit 3f4034c

Please sign in to comment.