From 2e2f5d5620806712e557f08318bdfc6d528effcb Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Tue, 2 Apr 2024 15:07:24 +0100 Subject: [PATCH] bash, brew: Switch from nvm to fnm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/Schniz/fnm Performance motivated — since my shell startup time was being greatly slowed by nvm. Also resolves [this](https://github.com/nvm-sh/nvm/issues/1645#issuecomment-396709449) incompatibility warning in macOS Terminal, where I was still looking for a workaround. --- bash/.profile | 7 +++---- bash/.zshrc | 4 ++++ brew/Brewfile | 1 + fish/.config/fish/config.fish | 1 + fish/.config/fish/fish_plugins | 1 - fish/.config/fish/functions/.gitignore | 2 -- fish/.config/fish/functions/nvm.fish | 3 --- 7 files changed, 9 insertions(+), 10 deletions(-) delete mode 100644 fish/.config/fish/functions/nvm.fish diff --git a/bash/.profile b/bash/.profile index eae74c2..fe69317 100644 --- a/bash/.profile +++ b/bash/.profile @@ -45,10 +45,9 @@ 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" +# fnm (Fast Node Manager) +export PATH=$HOME/Library/Application\ Support/fnm:$PATH +eval "`fnm env`" # Rust if [ -f $HOME/.cargo/env ]; then diff --git a/bash/.zshrc b/bash/.zshrc index 4de3cea..20d0855 100644 --- a/bash/.zshrc +++ b/bash/.zshrc @@ -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" diff --git a/brew/Brewfile b/brew/Brewfile index 462d58e..4010021 100644 --- a/brew/Brewfile +++ b/brew/Brewfile @@ -19,6 +19,7 @@ brew 'fastmod' brew 'fd' brew 'findutils' brew 'fish' +brew 'fnm' brew 'fzf' brew 'git' brew 'git-lfs' diff --git a/fish/.config/fish/config.fish b/fish/.config/fish/config.fish index e6d3de5..0ba9b33 100644 --- a/fish/.config/fish/config.fish +++ b/fish/.config/fish/config.fish @@ -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' diff --git a/fish/.config/fish/fish_plugins b/fish/.config/fish/fish_plugins index e651a3a..caf3b22 100644 --- a/fish/.config/fish/fish_plugins +++ b/fish/.config/fish/fish_plugins @@ -1,5 +1,4 @@ jorgebucaran/fisher -edc/bass jorgebucaran/autopair.fish jethrokuan/fzf jethrokuan/z diff --git a/fish/.config/fish/functions/.gitignore b/fish/.config/fish/functions/.gitignore index 278813d..adce830 100644 --- a/fish/.config/fish/functions/.gitignore +++ b/fish/.config/fish/functions/.gitignore @@ -4,5 +4,3 @@ fisher.fish __fzf*.fish __z*.fish _autopair*.fish -__bass* -bass.fish diff --git a/fish/.config/fish/functions/nvm.fish b/fish/.config/fish/functions/nvm.fish deleted file mode 100644 index 48b027c..0000000 --- a/fish/.config/fish/functions/nvm.fish +++ /dev/null @@ -1,3 +0,0 @@ -function nvm - bass source ~/.nvm/nvm.sh --no-use ';' nvm $argv -end