Skip to content

Commit

Permalink
bash, brew: Switch from nvm to fnm
Browse files Browse the repository at this point in the history
https://github.com/Schniz/fnm

Performance motivated — since my shell startup time was being greatly slowed by nvm.

Also resolves [this](nvm-sh/nvm#1645 (comment)) incompatibility warning in macOS Terminal, where I was still looking for a workaround.
  • Loading branch information
huntie committed Apr 2, 2024
1 parent 18aab6d commit e9be1b0
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 16 deletions.
21 changes: 11 additions & 10 deletions bash/.profile
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Homebrew
if [[ -f $HOME/homebrew/bin/brew ]]; then
eval "$($HOME/homebrew/bin/brew shellenv)"
elif [[ -f /opt/homebrew/bin/brew ]]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
fi

# Android SDK
if [[ -d $HOME/Library/Android/sdk ]]; then
export ANDROID_HOME=$HOME/Library/Android/sdk
Expand Down Expand Up @@ -26,11 +33,10 @@ if [[ -d $HOME/.fastlane/bin ]]; then
export PATH=$HOME/.fastlane/bin:$PATH
fi

# Homebrew
if [[ -f $HOME/homebrew/bin/brew ]]; then
eval "$($HOME/homebrew/bin/brew shellenv)"
elif [[ -f /opt/homebrew/bin/brew ]]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
# fnm (Fast Node Manager)
if [[ -f $HOMEBREW_PREFIX/bin/fnm ]]; then
export PATH=$HOME/Library/Application\ Support/fnm:$PATH
eval "`fnm env`"
fi

# jenv
Expand All @@ -45,11 +51,6 @@ if [[ -d $HOME/Library/Application\ Support/JetBrains/Toolbox/scripts ]]; then
export PATH=$HOME/Library/Application\ Support/JetBrains/Toolbox/scripts:$PATH
fi

# nvm
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"

# Rust
if [ -f $HOME/.cargo/env ]; then
source "$HOME/.cargo/env"
Expand Down
4 changes: 4 additions & 0 deletions bash/.zshrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Enable when profiling zsh, adding 'zprof' to the end of this file
# https://stevenvanbael.com/profiling-zsh-startup
# zmodload zsh/zprof

# Hook for VS Code terminal
if [[ -n $VSCODE_ZSH_INIT_COMMAND ]]; then
eval "$VSCODE_ZSH_INIT_COMMAND"
Expand Down
1 change: 1 addition & 0 deletions brew/Brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ brew 'fastmod'
brew 'fd'
brew 'findutils'
brew 'fish'
brew 'fnm'
brew 'fzf'
brew 'git'
brew 'git-lfs'
Expand Down
1 change: 1 addition & 0 deletions fish/.config/fish/config.fish
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ abbr -a ywd 'pwd | setclip'
abbr -a rsync 'rsync --progress'
abbr -a npmlist 'npm list -g --depth=0'
abbr -a rand 'openssl rand -base64'
abbr -a nvm fnm

alias sail './vendor/bin/sail'

Expand Down
1 change: 0 additions & 1 deletion fish/.config/fish/fish_plugins
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
jorgebucaran/fisher
edc/bass
jorgebucaran/autopair.fish
jethrokuan/fzf
jethrokuan/z
2 changes: 0 additions & 2 deletions fish/.config/fish/functions/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@ fisher.fish
__fzf*.fish
__z*.fish
_autopair*.fish
__bass*
bass.fish
3 changes: 0 additions & 3 deletions fish/.config/fish/functions/nvm.fish

This file was deleted.

0 comments on commit e9be1b0

Please sign in to comment.