Skip to content

Commit

Permalink
Profile and speed up zsh start by removing nvm stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
utensil committed Dec 31, 2024
1 parent 0acee66 commit 5500b7f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
13 changes: 10 additions & 3 deletions dotfiles/.zshrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# zmodload zsh/zprof

source $HOME/.envrc

eval "$(starship init zsh)"
Expand Down Expand Up @@ -75,6 +77,11 @@ source $(brew --prefix)/share/zsh-autosuggestions/zsh-autosuggestions.zsh
source $(brew --prefix)/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source $(brew --prefix)/opt/zsh-vi-mode/share/zsh-vi-mode/zsh-vi-mode.plugin.zsh

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
function needs_nvim() {
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
}

# zprof

7 changes: 6 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ keys-gt:

sync-gt:
mkdir -p ~/.config/
rm ~/.config/ghostty
rm ~/.config/ghostty || true
ln -s {{justfile_directory()}}/dotfiles/.config/ghostty ~/.config/ghostty

reset-gt:
Expand Down Expand Up @@ -644,6 +644,11 @@ view URL="http://localhost:1314/":
prep-zsh:
brew install zsh-autosuggestions zsh-syntax-highlighting zsh-vi-mode

# https://kasad.com/blog/zsh-profiling/
# also uncomment the lines at the start and the end of .zshrc
prof-zsh:
time zsh -i -c exit

prep-rc:
# copy with confirmation
cp -i dotfiles/.envrc ~/.envrc
Expand Down

0 comments on commit 5500b7f

Please sign in to comment.