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"
brew "ansible"
@ -32,6 +26,8 @@ brew "thefuck"
brew "trash", link: true
brew "wget"
brew "yt-dlp"
brew "nvm"
brew "go"
cask "alfred"
cask "bbedit"
@ -44,4 +40,5 @@ cask "orbstack"
cask "rectangle"
cask "syntax-highlight"
cask "visual-studio-code"
cask "keyboard-maestro"
cask "kaleidoscope"

View File

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

View File

@ -2,9 +2,8 @@
# NVM lazy loading wrapper for node
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/bash_completion" ] && \. "$NVM_DIR/bash_completion"
[ -s "$NVM_DIR/etc/bash_completion.d/nvm" ] && \. "$NVM_DIR/etc/bash_completion.d/nvm"
fi
exec node "$@"

View File

@ -2,9 +2,8 @@
# NVM lazy loading wrapper for npm
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/bash_completion" ] && \. "$NVM_DIR/bash_completion"
[ -s "$NVM_DIR/etc/bash_completion.d/nvm" ] && \. "$NVM_DIR/etc/bash_completion.d/nvm"
fi
exec npm "$@"

View File

@ -2,9 +2,8 @@
# NVM lazy loading wrapper for npx
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/bash_completion" ] && \. "$NVM_DIR/bash_completion"
[ -s "$NVM_DIR/etc/bash_completion.d/nvm" ] && \. "$NVM_DIR/etc/bash_completion.d/nvm"
fi
exec npx "$@"

4
.zshrc
View File

@ -121,11 +121,11 @@ function init_thefuck() {
alias fuck="init_thefuck"
### NVM
export NVM_DIR="$HOME/.nvm"
export NVM_DIR="/opt/homebrew/opt/nvm"
load_nvm() {
unset -f nvm load_nvm 2>/dev/null || true
[ -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 "$@"; }