Use NVM from brew and generally renew Brew config

This commit is contained in:
Tony Miller 2025-08-29 11:44:28 +10:00
parent 593edcf9c0
commit 68e0a94a81
6 changed files with 12 additions and 18 deletions

View File

@ -1,9 +1,3 @@
tap "homebrew/autoupdate"
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/cask-fonts"
tap "homebrew/core"
tap "homebrew/services"
tap "yt-dlp/taps" tap "yt-dlp/taps"
brew "ansible" brew "ansible"
@ -32,6 +26,8 @@ brew "thefuck"
brew "trash", link: true brew "trash", link: true
brew "wget" brew "wget"
brew "yt-dlp" brew "yt-dlp"
brew "nvm"
brew "go"
cask "alfred" cask "alfred"
cask "bbedit" cask "bbedit"
@ -44,4 +40,5 @@ cask "orbstack"
cask "rectangle" cask "rectangle"
cask "syntax-highlight" cask "syntax-highlight"
cask "visual-studio-code" cask "visual-studio-code"
cask "keyboard-maestro"
cask "kaleidoscope"

View File

@ -14,8 +14,8 @@ local DEFAULTS = {
local APPS = { local APPS = {
browser = {"Safari"}, browser = {"Safari"},
editors = {DEFAULTS["EDITOR"], {"Xcode"}, {"Code", "Visual Studio Code"}, {"IntelliJ IDEA"}}, editors = {DEFAULTS["EDITOR"], {"Xcode"}, {"Code", "Visual Studio Code"}, {"IntelliJ IDEA"}},
chats = {{"Telegram"}}, chats = {{"Microsoft Teams"}, {"Telegram"}},
messengers = {{"Telegram"}}, messengers = {{"Messages"}, {"Telegram"}},
music = {DEFAULTS["MUSIC"], {"Music"}}, music = {DEFAULTS["MUSIC"], {"Music"}},
calendar = {"Calendar"}, calendar = {"Calendar"},
terminal = {"iTerm", "iTerm2"}, terminal = {"iTerm", "iTerm2"},
@ -108,6 +108,7 @@ end
function app_is_running(apps, names) --it accepts list of apps to choose from for performance sake {{{3 function app_is_running(apps, names) --it accepts list of apps to choose from for performance sake {{{3
for i, app in ipairs(apps) do for i, app in ipairs(apps) do
print(app)
for i, name in ipairs(names) do for i, name in ipairs(names) do
if app:name() == name and #(app:allWindows()) > 0 then if app:name() == name and #(app:allWindows()) > 0 then
return true return true
@ -190,7 +191,6 @@ function app_pick(prev, apps, limit_running) --{{{3
return prev return prev
end end
if app_is_running(running, default) then -- optimisation, don't check for if installed if it's running if app_is_running(running, default) then -- optimisation, don't check for if installed if it's running
app_toggle(default) app_toggle(default)
used = default used = default

View File

@ -2,9 +2,8 @@
# NVM lazy loading wrapper for node # NVM lazy loading wrapper for node
if ! command -v nvm >/dev/null 2>&1; then if ! command -v nvm >/dev/null 2>&1; then
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" [ -s "$NVM_DIR/etc/bash_completion.d/nvm" ] && \. "$NVM_DIR/etc/bash_completion.d/nvm"
fi fi
exec node "$@" exec node "$@"

View File

@ -2,9 +2,8 @@
# NVM lazy loading wrapper for npm # NVM lazy loading wrapper for npm
if ! command -v nvm >/dev/null 2>&1; then if ! command -v nvm >/dev/null 2>&1; then
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" [ -s "$NVM_DIR/etc/bash_completion.d/nvm" ] && \. "$NVM_DIR/etc/bash_completion.d/nvm"
fi fi
exec npm "$@" exec npm "$@"

View File

@ -2,9 +2,8 @@
# NVM lazy loading wrapper for npx # NVM lazy loading wrapper for npx
if ! command -v nvm >/dev/null 2>&1; then if ! command -v nvm >/dev/null 2>&1; then
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" [ -s "$NVM_DIR/etc/bash_completion.d/nvm" ] && \. "$NVM_DIR/etc/bash_completion.d/nvm"
fi fi
exec npx "$@" exec npx "$@"

4
.zshrc
View File

@ -121,11 +121,11 @@ function init_thefuck() {
alias fuck="init_thefuck" alias fuck="init_thefuck"
### NVM ### NVM
export NVM_DIR="$HOME/.nvm" export NVM_DIR="/opt/homebrew/opt/nvm"
load_nvm() { load_nvm() {
unset -f nvm load_nvm 2>/dev/null || true unset -f nvm load_nvm 2>/dev/null || true
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" [ -s "$NVM_DIR/etc/bash_completion.d/nvm" ] && \. "$NVM_DIR/etc/bash_completion.d/nvm"
} }
nvm() { load_nvm; nvm "$@"; } nvm() { load_nvm; nvm "$@"; }