diff --git a/macos/.hammerspoon/init.lua b/macos/.hammerspoon/init.lua index bcd1737..b5c1712 100644 --- a/macos/.hammerspoon/init.lua +++ b/macos/.hammerspoon/init.lua @@ -24,32 +24,40 @@ for key, application in pairs(applicationHotKeys) do end) end +-------------------------------------------------------------------------------- +-- Spotlight +-------------------------------------------------------------------------------- + +-- hs.hotkey.bind({}, 'f18', function() +-- hs.alert.show("Hello World!") +-- end) + -------------------------------------------------------------------------------- -- Window Snapping -------------------------------------------------------------------------------- hs.window.animationDuration = 0 -hs.hotkey.bind(hyper, 'Left', function() +hs.hotkey.bind(hyper, 'a', function() local win = hs.window.focusedWindow() if not win then return end win:moveToUnit(hs.layout.left50) end) -hs.hotkey.bind(hyper, 'Right', function() +hs.hotkey.bind(hyper, 'd', function() local win = hs.window.focusedWindow() if not win then return end win:moveToUnit(hs.layout.right50) end) -hs.hotkey.bind(hyper, 'Up', function() +hs.hotkey.bind(hyper, 'w', function() local win = hs.window.focusedWindow() if not win then return end win:moveToUnit(hs.layout.maximized) end) -- Simulates a 'reset' of the window -hs.hotkey.bind(hyper, 'Down', function() +hs.hotkey.bind(hyper, 's', function() local win = hs.window.focusedWindow() local f = win:frame() local screen = win:screen() diff --git a/zsh/.zshrc b/zsh/.zshrc index 40889fa..4b1dacf 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -82,27 +82,31 @@ PS1=' %F{blue}%~$(git_prompt) %F{244}%# %F{reset}' -# Only autoload nvm on a specific machine, default to lazy loading -# TODO: Maybe drop the lazy loading entirely as I never use nvm outside of work? -if [[ $(hostname) == "x1carbon.josh" ]]; then - export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] \ - && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" +# No lazy loading on macOS +if [[ `uname` == Darwin ]]; then + export NVM_DIR="$HOME/.nvm" + [ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh" else - # Run `nvm` init script on demand to avoid constant slow downs - function nvm { - if [ -z ${NVM_DIR+x} ]; then - export NVM_DIR="$HOME/.nvm" + # Only autoload nvm on a specific machine, default to lazy loading + # TODO: Maybe drop the lazy loading entirely as I never use nvm outside of work? + if [[ $(hostname) == "x1carbon.josh" ]]; then + export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] \ + && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" + else + # Run `nvm` init script on demand to avoid constant slow downs + function nvm { + if [ -z ${NVM_DIR+x} ]; then + export NVM_DIR="$HOME/.nvm" - if [ -s "/opt/homebrew/opt/nvm/nvm.sh" ]; then - source "/opt/homebrew/opt/nvm/nvm.sh" - elif [ -s "$NVM_DIR/nvm.sh" ]; then - source "$NVM_DIR/nvm.sh" - elif [ -s "/usr/share/nvm/init-nvm.sh" ]; then - source /usr/share/nvm/init-nvm.sh + if [ -s "$NVM_DIR/nvm.sh" ]; then + source "$NVM_DIR/nvm.sh" + elif [ -s "/usr/share/nvm/init-nvm.sh" ]; then + source /usr/share/nvm/init-nvm.sh + fi + + nvm "$@" fi - - nvm "$@" - fi - } + } + fi fi