From 6a6cd3bc798720af4fb45248763d9494f768e393 Mon Sep 17 00:00:00 2001 From: turtlebasket Date: Fri, 18 Jul 2025 11:42:05 -0700 Subject: [PATCH] misc macos updates --- README.md | 4 - config/hammerspoon/init.lua | 599 +++++++++------- config/iterm2/com.googlecode.iterm2.plist | 832 +++++++++++++++++++++- config/neovim/macos/init.lua | 38 +- 4 files changed, 1177 insertions(+), 296 deletions(-) diff --git a/README.md b/README.md index e139e14..cb4d08d 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,5 @@ # Environment -![macOS](https://img.shields.io/badge/mac%20os-000000?style=for-the-badge&logo=macos&logoColor=F0F0F0) -![Fedora](https://img.shields.io/badge/Fedora-294172?style=for-the-badge&logo=fedora&logoColor=white) -![Windows](https://img.shields.io/badge/Windows-0078D6?style=for-the-badge&logo=windows&logoColor=white) - ## Contents - [Configs](./config/) diff --git a/config/hammerspoon/init.lua b/config/hammerspoon/init.lua index ea7c757..f09cbda 100644 --- a/config/hammerspoon/init.lua +++ b/config/hammerspoon/init.lua @@ -1,429 +1,517 @@ -wf=hs.window.filter -ffBrowser = "Firefox" -chromiumBrowser = "Brave Browser" --- browser = "Chromium" +wf = hs.window.filter +-------------------------------------------------------------------- -- Open new / focus existing Finder window in current desktop space +-------------------------------------------------------------------- -hs.hotkey.bind({"cmd", "ctrl"}, "X", function() +hs.hotkey.bind({ "cmd", "ctrl" }, "X", function() local app = "Finder" - wf_app = wf.new(false):setAppFilter(app, {currentSpace=true}) + wf_app = wf.new(false):setAppFilter(app, { currentSpace = true }) local wins = wf_app:getWindows() local count = 0 - for _ in pairs(wins) do count = count + 1 end - - if (count > 0) - then - wf_app:getWindows()[1]:focus() - else - hs.osascript.applescript(string.format([[ - tell application "System Events" to tell process "%s" - click menu item "New Finder Window" of menu "File" of menu bar 1 - set frontmost to true - end tell - ]], app)) + for _ in pairs(wins) do + count = count + 1 end + if count > 0 then + wf_app:getWindows()[1]:focus() + else + hs.osascript.applescript(string.format( + [[ + tell application "System Events" to tell process "%s" + click menu item "New Finder Window" of menu "File" of menu bar 1 + set frontmost to true + end tell + ]], + app + )) + end end) -- Open new / focus existing terminal window in current desktop space --- hs.hotkey.bind({"cmd", "ctrl"}, "T", function() --- -- Adjust the app filter to Warp --- wf_warp = wf.new(false):setAppFilter("Warp", {currentSpace=true, visible=true}) --- --- local wins = wf_warp:getWindows() --- local count = 0 --- for _ in pairs(wins) do count = count + 1 end --- --- if (count > 0) then --- wf_warp:getWindows()[1]:focus() --- else --- hs.osascript.applescript([[ --- tell application "System Events" to tell process "Warp" --- click menu item "New Window" of menu "File" of menu bar 1 --- end tell --- ]]) --- end --- end) +function focusOrOpenGhostty() + wf_ghostty = wf.new(false):setAppFilter("Ghostty", { currentSpace = true, visible = true }) --- hs.hotkey.bind({"cmd", "ctrl"}, "T", function() --- wf_kitty = wf.new(false):setAppFilter("kitty", {currentSpace=true, visible=true}) --- local wins = wf_kitty:getWindows() --- local count = 0 --- for _ in pairs(wins) do count = count + 1 end --- --- if (count > 0) --- then --- wf_kitty:getWindows()[1]:focus() --- else --- hs.osascript.applescript([[ --- tell application "System Events" to tell process "kitty" --- click menu item "New OS Window" of menu "Shell" of menu bar 1 --- end tell --- ]]) --- end --- end) + local wins = wf_ghostty:getWindows() + local count = 0 + for _ in pairs(wins) do + count = count + 1 + end -hs.hotkey.bind({"cmd", "ctrl"}, "T", function() - wf_iterm2 = wf.new(false):setAppFilter("iTerm2", {currentSpace=true, visible=true}) + if count > 0 then + wf_ghostty:getWindows()[1]:focus() + else + hs.osascript.applescript([[ + tell application "System Events" to tell process "Ghostty" + click menu item "New Window" of menu "File" of menu bar 1 + end tell + ]]) + end +end + +function focusOrOpenWarp() + -- Adjust the app filter to Warp + wf_warp = wf.new(false):setAppFilter("Warp", { currentSpace = true, visible = true }) + + local wins = wf_warp:getWindows() + local count = 0 + for _ in pairs(wins) do + count = count + 1 + end + + if count > 0 then + wf_warp:getWindows()[1]:focus() + else + hs.osascript.applescript([[ + tell application "System Events" to tell process "Warp" + click menu item "New Window" of menu "File" of menu bar 1 + end tell + ]]) + end +end + +function focusOrOpenKitty() + wf_kitty = wf.new(false):setAppFilter("kitty", { currentSpace = true, visible = true }) + + local wins = wf_kitty:getWindows() + local count = 0 + for _ in pairs(wins) do + count = count + 1 + end + + if count > 0 then + wf_kitty:getWindows()[1]:focus() + else + hs.osascript.applescript([[ + tell application "System Events" to tell process "kitty" + click menu item "New OS Window" of menu "Shell" of menu bar 1 + end tell + ]]) + end +end + +function focusOrOpeniTerm() + wf_iterm2 = wf.new(false):setAppFilter("iTerm2", { currentSpace = true, visible = true }) local wins = wf_iterm2:getWindows() local count = 0 - for _ in pairs(wins) do count = count + 1 end + for _ in pairs(wins) do + count = count + 1 + end - if (count > 0) - then + if count > 0 then wf_iterm2:getWindows()[1]:focus() else hs.osascript.applescript([[ - tell application "iTerm" - create window with default profile - activate - end tell - ]]) + tell application "iTerm" + create window with default profile + activate + end tell + ]]) end +end -end) +hs.hotkey.bind({ "cmd", "ctrl" }, "T", focusOrOpeniTerm) +-------------------------------------------------------------------- -- Open new / focus existing browser window in current desktop space +-------------------------------------------------------------------- + +ffBrowser = "Firefox" +chromiumBrowser = "Brave Browser" function focusOrOpenFirefox() - -- assumes wf_browser is the name of a firefox-based browser - wf_browser = wf.new(false):setAppFilter(ffBrowser, {currentSpace=true, visible=true}) + wf_browser = wf.new(false):setAppFilter(ffBrowser, { currentSpace = true, visible = true }) local wins = wf_browser:getWindows() local count = 0 - for _ in pairs(wins) do count = count + 1 end - - if (count > 0) - then + for _ in pairs(wins) do + count = count + 1 + end + + if count > 0 then wf_browser:getWindows()[1]:focus() -- print(count) else -- for firefox: - hs.osascript.applescript(string.format([[ - tell application "System Events" to tell process "%s" - click menu item "New Window" of menu "File" of menu bar 1 - set frontmost to true - end tell - ]], ffBrowser)) + hs.osascript.applescript(string.format( + [[ + tell application "System Events" to tell process "%s" + click menu item "New Window" of menu "File" of menu bar 1 + set frontmost to true + end tell + ]], + ffBrowser + )) end - end function focusOrOpenChromium() - -- assumes wf_browser is the name of a chromium-based browser - wf_browser = wf.new(false):setAppFilter(chromiumBrowser, {currentSpace=true, visible=true}) + wf_browser = wf.new(false):setAppFilter(chromiumBrowser, { currentSpace = true, visible = true }) local wins = wf_browser:getWindows() local count = 0 - for _ in pairs(wins) do count = count + 1 end - - if (count > 0) - then + for _ in pairs(wins) do + count = count + 1 + end + + if count > 0 then wf_browser:getWindows()[1]:focus() -- print(count) else - hs.osascript.applescript(string.format([[ - tell application "%s" - make new window - activate - end tell - ]], chromiumBrowser)) + hs.osascript.applescript(string.format( + [[ + tell application "%s" + make new window + activate + end tell + ]], + chromiumBrowser + )) end - end -hs.hotkey.bind({"cmd", "ctrl"}, "W", focusOrOpenChromium) +hs.hotkey.bind({ "cmd", "ctrl" }, "W", focusOrOpenChromium) - --- CHROMIUM-BASED BROWSERS ONLY: Open new tab to right of current browser --- NOTE: currently replaced with binding in chromiumsystem settings +-- CHROMIUM-BASED BROWSERS ONLY: Open new tab to right of currently-focused one +-- NOTE: This can be replaced with a dedicated keybind in chromium system settings -- hs.hotkey.bind({"cmd", "option"}, "T", function() --- --- local focusedAppName = hs.window.focusedWindow():application():title() --- --- if focusedAppName == chromiumBrowser --- then --- hs.osascript.applescript(string.format([[ --- tell application "System Events" to tell process "%s" --- click menu item "New Tab to the Right" of menu "Tab" of menu bar 1 --- end tell --- ]], focusedAppName)) --- else --- hs.notify.new({title=string.format("%s not focused.", browser)}):send() --- end --- +-- +-- local focusedAppName = hs.window.focusedWindow():application():title() +-- +-- if focusedAppName == chromiumBrowser +-- then +-- hs.osascript.applescript(string.format([[ +-- tell application "System Events" to tell process "%s" +-- click menu item "New Tab to the Right" of menu "Tab" of menu bar 1 +-- end tell +-- ]], focusedAppName)) +-- else +-- hs.notify.new({title=string.format("%s not focused.", browser)}):send() +-- end -- end) - -- Open new / focus existing vscode window in current desktop space -- app = VSCodium, Code, or Cursor function openVsCode(app) - wf_app = wf.new(false):setAppFilter(app, {currentSpace=true, visible=true}) + wf_app = wf.new(false):setAppFilter(app, { currentSpace = true, visible = true }) local wins = wf_app:getWindows() local count = 0 - for _ in pairs(wins) do count = count + 1 end - - if (count > 0) then + for _ in pairs(wins) do + count = count + 1 + end + + if count > 0 then wf_app:getWindows()[1]:focus() else - hs.osascript.applescript(string.format([[ + hs.osascript.applescript(string.format( + [[ tell application "System Events" to tell process "%s" click menu item "New Window" of menu "File" of menu bar 1 set frontmost to true end tell - ]], app)) + ]], + app + )) end - end +--------------------------------------------------------------------------- +-- Focus or open editor of choice in current desktop space +--------------------------------------------------------------------------- --- superbinding to use both cursor and vscode --- try to focus cursor (primarily) or vscode (secondarily), then open cursor if neither is open -function tryFocusCursorOrVSCodeThenOpenCursor() - wf_cursor= wf.new(false):setAppFilter("Cursor", {currentSpace=true, visible=true}) - wf_vscode= wf.new(false):setAppFilter("Code", {currentSpace=true, visible=true}) +-- superbinding to use multiple editors with a preferred order +-- e.g. try to focus cursor (primarily) or vscode (secondarily), then open cursor if neither is open +function tryFocusAnEditorThenOpenCursor() + wf_cursor = wf.new(false):setAppFilter("Cursor", { currentSpace = true, visible = true }) + wf_vscode = wf.new(false):setAppFilter("Code", { currentSpace = true, visible = true }) local cursor_wins = wf_cursor:getWindows() local cursor_count = 0 - for _ in pairs(cursor_wins) do cursor_count = cursor_count + 1 end + for _ in pairs(cursor_wins) do + cursor_count = cursor_count + 1 + end local vscode_wins = wf_vscode:getWindows() local vscode_count = 0 - for _ in pairs(vscode_wins) do vscode_count = vscode_count + 1 end + for _ in pairs(vscode_wins) do + vscode_count = vscode_count + 1 + end - if (cursor_count > 0) then + if cursor_count > 0 then wf_cursor:getWindows()[1]:focus() - elseif (vscode_count > 0) then + elseif vscode_count > 0 then wf_vscode:getWindows()[1]:focus() else - hs.osascript.applescript(string.format([[ + hs.osascript.applescript(string.format( + [[ tell application "System Events" to tell process "%s" click menu item "New Window" of menu "File" of menu bar 1 set frontmost to true end tell - ]], "Cursor")) + ]], + "Cursor" + )) end - end -hs.hotkey.bind({"cmd", "ctrl"}, "E", function() +hs.hotkey.bind({ "cmd", "ctrl" }, "E", function() -- openVsCode("Cursor") -- openVsCode("Code") - tryFocusCursorOrVSCodeThenOpenCursor() + tryFocusAnEditorThenOpenCursor() end) -hs.hotkey.bind({"cmd", "ctrl"}, "V", function() - openVsCode("Code") -end) - - --- hs.hotkey.bind({"cmd", "ctrl"}, "V", function() - -- openVsCode("Code") - -- openVsCode("VSCodium") - - -- No neovide function because it doesn't support system events (yet) - -- hs.application.open("Neovide") --- end) - - - --- Open new / focus existing g/n/mac/vim(r) window in current desktop space - -- hs.hotkey.bind({"cmd", "ctrl"}, "E", function() --- local app = "VimR" --- --- wf_app = wf.new(false):setAppFilter(app, {currentSpace=true, visible=true}) --- --- local wins = wf_app:getWindows() --- local count = 0 --- for _ in pairs(wins) do count = count + 1 end --- --- if (count > 0) --- then --- wf_app:getWindows()[1]:focus() --- else --- hs.osascript.applescript(string.format([[ --- tell application "System Events" to tell process "%s" --- click menu item "New Window" of menu "File" of menu bar 1 --- set frontmost to true --- end tell --- ]], app)) --- --- end --- +-- local app = "VimR" +-- +-- wf_app = wf.new(false):setAppFilter(app, {currentSpace=true, visible=true}) +-- +-- local wins = wf_app:getWindows() +-- local count = 0 +-- for _ in pairs(wins) do count = count + 1 end +-- +-- if (count > 0) +-- then +-- wf_app:getWindows()[1]:focus() +-- else +-- hs.osascript.applescript(string.format([[ +-- tell application "System Events" to tell process "%s" +-- click menu item "New Window" of menu "File" of menu bar 1 +-- set frontmost to true +-- end tell +-- ]], app)) +-- +-- end +-- -- end) -- APP-AGNOSTIC GLOBAL OPEN/FOCUS BINDINGS -- common apps --- hs.hotkey.bind({"cmd", "ctrl"}, "R", function() hs.application.open("Obsidian") end) -hs.hotkey.bind({"cmd", "ctrl"}, "M", function() hs.application.open("Spotify") end) -hs.hotkey.bind({"cmd", "ctrl"}, "G", function() hs.application.open("Google Calendar") end) -hs.hotkey.bind({"cmd", "ctrl"}, "Z", function() hs.application.open("Preview") end) -hs.hotkey.bind({"cmd", "ctrl"}, "C", function() hs.application.open("Open WebUI") end) +-- hs.hotkey.bind({"cmd", "ctrl"}, "R", function() hs.application.open("Obsidian") end) +hs.hotkey.bind({ "cmd", "ctrl" }, "M", function() + hs.application.open("Spotify") +end) +hs.hotkey.bind({ "cmd", "ctrl" }, "G", function() + hs.application.open("Google Calendar") +end) +hs.hotkey.bind({ "cmd", "ctrl" }, "Z", function() + hs.application.open("Preview") +end) +hs.hotkey.bind({ "cmd", "ctrl" }, "C", function() + hs.application.open("Open WebUI") +end) -- annoying apps (must manually open) -hs.hotkey.bind({"cmd", "ctrl"}, "A", function() switchToIfApplicationOpen("Telegram") end) -hs.hotkey.bind({"cmd", "ctrl"}, "S", function() switchToIfApplicationOpen("Signal") end) -hs.hotkey.bind({"cmd", "ctrl"}, "N", function() switchToIfApplicationOpen("Numi") end) --- hs.hotkey.bind({"cmd", "ctrl"}, "S", function() switchToIfApplicationOpen("Texts") end) --- hs.hotkey.bind({"cmd", "ctrl", "shift"}, "S", function() hs.application.open("Signal") end) -hs.hotkey.bind({"cmd", "ctrl"}, "K", function() switchToIfApplicationOpen("KiCad") end) --- hs.hotkey.bind({"cmd", "ctrl"}, "C", function() switchToIfApplicationOpen("CLion") end) -hs.hotkey.bind({"cmd", "ctrl"}, "J", function() switchToIfApplicationOpen("IntelliJ IDEA") end) --- hs.hotkey.bind({"cmd", "ctrl"}, "L", function() switchToIfApplicationOpen("Linear") end) -hs.hotkey.bind({"cmd", "ctrl"}, "L", function() switchToIfApplicationOpen("LTspice") end) - +hs.hotkey.bind({ "cmd", "ctrl" }, "A", function() + switchToIfApplicationOpen("Telegram") +end) +hs.hotkey.bind({ "cmd", "ctrl" }, "S", function() + switchToIfApplicationOpen("Signal") +end) +hs.hotkey.bind({ "cmd", "ctrl" }, "N", function() + switchToIfApplicationOpen("Numi") +end) +-- hs.hotkey.bind({"cmd", "ctrl"}, "S", function() switchToIfApplicationOpen("Texts") end) +-- hs.hotkey.bind({"cmd", "ctrl", "shift"}, "S", function() hs.application.open("Signal") end) +hs.hotkey.bind({ "cmd", "ctrl" }, "K", function() + switchToIfApplicationOpen("KiCad") +end) +-- hs.hotkey.bind({"cmd", "ctrl"}, "C", function() switchToIfApplicationOpen("CLion") end) +hs.hotkey.bind({ "cmd", "ctrl" }, "J", function() + switchToIfApplicationOpen("IntelliJ IDEA") +end) +-- hs.hotkey.bind({"cmd", "ctrl"}, "L", function() switchToIfApplicationOpen("Linear") end) +hs.hotkey.bind({ "cmd", "ctrl" }, "L", function() + switchToIfApplicationOpen("LTspice") +end) -- Clear clipboard -hs.hotkey.bind({"cmd", "shift", "ctrl"}, "C", function() +hs.hotkey.bind({ "cmd", "shift", "ctrl" }, "C", function() hs.pasteboard.setContents("") - hs.notify.new({title="Cleared clipboard."}):send() + hs.notify.new({ title = "Cleared clipboard." }):send() end) +-- open Perplexity in Brave-based browser +-- 1. if perplexity is already open in most recent Brave window, switch to it and open +-- perplexity in new tab to the right +-- 2. if not, switch to most recent Brave window and open perplexity +hs.hotkey.bind({ "cmd", "shift" }, "space", function() + hs.osascript.applescript(string.format( + [[ + tell application "%s" + if (count of windows) = 0 then + make new window + end if + activate + + set foundTab to false + set tabIndex to 0 + repeat with i from 1 to (count of tabs of front window) + if URL of tab i of front window contains "perplexity.ai" then + set foundTab to true + set tabIndex to i + exit repeat + end if + end repeat + + if foundTab then + set active tab index of front window to tabIndex + else + tell application "System Events" to tell process "%s" + click menu item "New Tab to the Right" of menu "Tab" of menu bar 1 + end tell + + delay 0.01 + + set URL of active tab of front window to "https://perplexity.ai" + end if + end tell + ]], + chromiumBrowser, + chromiumBrowser + )) +end) --------------------------------------- +--------------------------------------------------------------------------- -- DESKTOP SWITCHING (axed) -- Retroactive note: it should be harder, not easier, to context-switch :P --------------------------------------- +--------------------------------------------------------------------------- -- function gotoDesktopNumber(desktop) -- local deskstr = string.format("Desktop %d", desktop) --- local index = 0 --- for item in hs.spaces.spacesForScreen("Main") do --- if item == deskstr then --- break --- else --- index = index + 1 --- end --- end --- print("INDEX ", index) --- hs.spaces.gotoSpace(index) +-- local index = 0 +-- for item in hs.spaces.spacesForScreen("Main") do +-- if item == deskstr then +-- break +-- else +-- index = index + 1 +-- end +-- end +-- print("INDEX ", index) +-- hs.spaces.gotoSpace(index) -- end --- +-- -- hs.hotkey.bind({"cmd", "ctrl"}, "1", function() gotoDesktopNumber(1) end) -- hs.hotkey.bind({"cmd", "ctrl"}, "2", function() gotoDesktopNumber(2) end) -- hs.hotkey.bind({"cmd", "ctrl"}, "3", function() gotoDesktopNumber(3) end) -- hs.hotkey.bind({"cmd", "ctrl"}, "4", function() gotoDesktopNumber(4) end) --------------------------------------- +--------------------------------------------------------------------------- -- SWITCH TO IF OPEN -- Switches to application if there's an instance of it open --------------------------------------- +--------------------------------------------------------------------------- function switchToIfWindowOpen(app) - wf_app = wf.new(false):setAppFilter(app, {currentSpace=true, visible=true}) + wf_app = wf.new(false):setAppFilter(app, { currentSpace = true, visible = true }) local wins = wf_app:getWindows() local count = 0 - for _ in pairs(wins) do count = count + 1 end - - if (count > 0) then + for _ in pairs(wins) do + count = count + 1 + end + + if count > 0 then wf_app:getWindows()[1]:focus() - end + end end - --------------------------------------- +--------------------------------------------------------------------------- -- SWITCH TO IF GLOBALLY OPEN -- Switches to application if there's an instance of it open --------------------------------------- +--------------------------------------------------------------------------- function switchToIfApplicationOpen(appName) - local runningApps = hs.application.runningApplications() - local isOpen = false - for _, app in pairs(runningApps) do - if app:name() == appName then - isOpen = true - break - end - end + local runningApps = hs.application.runningApplications() + local isOpen = false + for _, app in pairs(runningApps) do + if app:name() == appName then + isOpen = true + break + end + end - if (isOpen) then - hs.application.open(appName) - end + if isOpen then + hs.application.open(appName) + end end - --------------------------------------- +--------------------------------------------------------------------------- -- KEY COMBO TO APPLICATION -- Sends keystrokes but only if the specified application is focused --------------------------------------- +--------------------------------------------------------------------------- function sendKeyComboToApplication(appComboTable) - for appComboPair in ipairs(appComboTable) do - app = appComboPair[1] mods = appComboPair[2] key = appComboPair[3] - - wf_app = wf.new(false):setAppFilter(app, {currentSpace=true, visible=true}) + + wf_app = wf.new(false):setAppFilter(app, { currentSpace = true, visible = true }) local wins = wf_app:getWindows() local count = 0 - for _ in pairs(wins) do count = count + 1 end - - if (count > 0) - then - hs.eventtap.keyStroke(mods, key) + for _ in pairs(wins) do + count = count + 1 end + if count > 0 then + hs.eventtap.keyStroke(mods, key) + end end - end -------------------- --- A R C H I V E -- -------------------- +--------------------------------------------------------------------------- +-- ARCHIVE +-- +-- Notes: +-- - Win-tab is now just set in system settings +-- - Desktop / window action hotkeys are now managed with Rectangle.app +--------------------------------------------------------------------------- -- Desktop Action Hotkeys (MOVED TO SYSTEM SETTINGS) -- -- Show Desktop (like windows or KDE) --- +-- -- hs.hotkey.bind({"alt"}, "d", function() --- hs.eventtap.keyStroke({"fn"}, "f11") +-- hs.eventtap.keyStroke({"fn"}, "f11") -- end) --- +-- -- -- Switch Desktops (like windows or KDE) --- +-- -- hs.hotkey.bind({"ctrl", "alt"}, "left", function() --- hs.eventtap.keyStroke({"ctrl"}, "left") +-- hs.eventtap.keyStroke({"ctrl"}, "left") -- end) --- +-- -- hs.hotkey.bind({"ctrl", "alt"}, "right", function() --- hs.eventtap.keyStroke({"ctrl"}, "right") +-- hs.eventtap.keyStroke({"ctrl"}, "right") -- end) --- --- +-- +-- -- -- Expose Windows (Mission Control) --- --- hs.hotkey.bind({"alt"}, "tab", function() --- hs.application.open("Mission Control"):activate() +-- +-- hs.hotkey.bind({"alt"}, "tab", function() +-- hs.application.open("Mission Control"):activate() -- end) - -- Move windows between displays -- hs.hotkey.bind({"ctrl", "shift"}, "right", function() --- hs.window.focusedWindow():moveToScreen(hs.screen:next()) +-- hs.window.focusedWindow():moveToScreen(hs.screen:next()) -- end) --- +-- -- hs.hotkey.bind({"ctrl", "shift"}, "left", function() --- hs.window.focusedWindow():moveToScreen(hs.screen:previous()) +-- hs.window.focusedWindow():moveToScreen(hs.screen:previous()) -- end) - --- The ShiftIt Alternative (MOVED TO RECTANGLE) +-- The ShiftIt Alternative -- units = { -- right50 = { x = 0.50, y = 0.00, w = 0.50, h = 1.00 }, @@ -438,7 +526,7 @@ end -- botleft50 = { x = 0.00, y = 0.50, w = 0.50, h = 0.50 }, -- maximum = { x = 0.00, y = 0.00, w = 1.00, h = 1.00 } -- } --- +-- -- mash = { 'shift', 'ctrl', 'cmd' } -- hs.hotkey.bind(mash, 'l', function() hs.window.focusedWindow():move(units.right50, nil, true) end) -- hs.hotkey.bind(mash, 'h', function() hs.window.focusedWindow():move(units.left50, nil, true) end) @@ -448,4 +536,3 @@ end -- hs.hotkey.bind(mash, '[', function() hs.window.focusedWindow():move(units.upleft50, nil, true) end) -- hs.hotkey.bind(mash, ';', function() hs.window.focusedWindow():move(units.botleft50, nil, true) end) -- hs.hotkey.bind(mash, "'", function() hs.window.focusedWindow():move(units.botright50, nil, true) end) - diff --git a/config/iterm2/com.googlecode.iterm2.plist b/config/iterm2/com.googlecode.iterm2.plist index 36ad348..1dcc5d1 100644 --- a/config/iterm2/com.googlecode.iterm2.plist +++ b/config/iterm2/com.googlecode.iterm2.plist @@ -10,10 +10,20 @@ The script should do this: \(ai.prompt) 128000 AiModel gpt-4o + AitermURL + https://api.openai.com/v1/completions AitermUseLegacyAPI AlternateMouseScroll + ClosingTmuxTabKillsTmuxWindows + + ClosingTmuxTabKillsTmuxWindows_selection + 1 + ClosingTmuxWindowKillsTmuxWindows + + ClosingTmuxWindowKillsTmuxWindows_selection + 1 Custom Color Presets Brogrammer @@ -300,6 +310,19 @@ The script should do this: \(ai.prompt) Text + 0xd-0x20000-0x24 + + Action + 12 + Keycode + 13 + Modifiers + 131072 + Text + \n + Version + 1 + 0xf700-0x300000 Action @@ -592,7 +615,7 @@ The script should do this: \(ai.prompt) Close Sessions On End Columns - 144 + 158 Command Cursor Color @@ -869,13 +892,6 @@ The script should do this: \(ai.prompt) Text [1;6A - 0xf700-0x280000 - - Action - 11 - Text - 0x1b 0x1b 0x5b 0x41 - 0xf701-0x220000-0x0 Action @@ -897,13 +913,6 @@ The script should do this: \(ai.prompt) Text [1;6B - 0xf701-0x280000 - - Action - 11 - Text - 0x1b 0x1b 0x5b 0x42 - 0xf702-0x220000-0x0 Action @@ -1196,9 +1205,796 @@ The script should do this: \(ai.prompt) Working Directory /Users/michael + + ASCII Anti Aliased + + ASCII Ligatures + + Ambiguous Double Width + + Ansi 0 Color + + Blue Component + 0.12343787401914597 + Green Component + 0.12343578040599823 + Red Component + 0.1234394758939743 + + Ansi 1 Color + + Blue Component + 0.095619738101959229 + Green Component + 0.067135065793991089 + Red Component + 0.97170770168304443 + + Ansi 10 Color + + Blue Component + 0.379891037940979 + Green Component + 0.82695949077606201 + Red Component + 0.11459558457136154 + + Ansi 11 Color + + Blue Component + 0.035377603024244308 + Green Component + 0.74144089221954346 + Red Component + 0.95126962661743164 + + Ansi 12 Color + + Blue Component + 0.838664710521698 + Green Component + 0.50448882579803467 + Red Component + 0.061654355376958847 + + Ansi 13 Color + + Blue Component + 0.72698760032653809 + Green Component + 0.3135044276714325 + Red Component + 0.32478702068328857 + + Ansi 14 Color + + Blue Component + 0.85764402151107788 + Green Component + 0.4900696873664856 + Red Component + 0.059441849589347839 + + Ansi 15 Color + + Blue Component + 1 + Green Component + 1 + Red Component + 1 + + Ansi 2 Color + + Blue Component + 0.36823004484176636 + Green Component + 0.77383565902709961 + Red Component + 0.17600196599960327 + + Ansi 3 Color + + Blue Component + 0.060177117586135864 + Green Component + 0.72761225700378418 + Red Component + 0.92706489562988281 + + Ansi 4 Color + + Blue Component + 0.82454067468643188 + Green Component + 0.51804500818252563 + Red Component + 0.16567224264144897 + + Ansi 5 Color + + Blue Component + 0.71787959337234497 + Green Component + 0.35215187072753906 + Red Component + 0.30770933628082275 + + Ansi 6 Color + + Blue Component + 0.838664710521698 + Green Component + 0.50448882579803467 + Red Component + 0.061654355376958847 + + Ansi 7 Color + + Blue Component + 0.89713811874389648 + Green Component + 0.8579363226890564 + Red Component + 0.84028750658035278 + + Ansi 8 Color + + Blue Component + 0.89713811874389648 + Green Component + 0.8579363226890564 + Red Component + 0.84028750658035278 + + Ansi 9 Color + + Blue Component + 0.1818375289440155 + Green Component + 0.20686990022659302 + Red Component + 0.87161564826965332 + + BM Growl + + Background Color + + Blue Component + 0.076218985021114349 + Green Component + 0.076217696070671082 + Red Component + 0.07621997594833374 + + Background Image Location + + Badge Color + + Alpha Component + 0.5 + Blue Component + 0.0 + Color Space + sRGB + Green Component + 0.1491314172744751 + Red Component + 1 + + Blinking Cursor + + Blur + + Bold Color + + Blue Component + 0.89713811874389648 + Green Component + 0.8579363226890564 + Red Component + 0.84028750658035278 + + Character Encoding + 4 + Close Sessions On End + + Columns + 144 + Command + + Cursor Color + + Blue Component + 0.72549021244049072 + Green Component + 0.72549021244049072 + Red Component + 0.72549021244049072 + + Cursor Guide Color + + Alpha Component + 0.25 + Blue Component + 1 + Color Space + sRGB + Green Component + 0.9268307089805603 + Red Component + 0.70213186740875244 + + Cursor Text Color + + Blue Component + 0.062745101749897003 + Green Component + 0.062745101749897003 + Red Component + 0.062745101749897003 + + Custom Command + No + Custom Directory + No + Default Bookmark + No + Description + Default + Disable Window Resizing + + Faint Text Alpha + 0.5 + Flashing Bell + + Foreground Color + + Blue Component + 0.89713811874389648 + Green Component + 0.8579363226890564 + Red Component + 0.84028750658035278 + + Guid + 38D0C455-B853-46AE-B4AC-947B6FDDCD77 + Has Hotkey + + Horizontal Spacing + 1 + Icon + 0 + Idle Code + 0 + Jobs to Ignore + + rlogin + ssh + slogin + telnet + + Keyboard Map + + 0x2a-0x200000-0x0 + + Action + 12 + Text + * + + 0x2b-0x200000-0x0 + + Action + 12 + Text + + + + 0x2d-0x200000-0x0 + + Action + 12 + Text + - + + 0x2d-0x40000-0x0 + + Action + 11 + Text + 0x1f + + 0x2e-0x200000-0x0 + + Action + 12 + Text + . + + 0x2f-0x200000-0x0 + + Action + 12 + Text + / + + 0x3-0x200000-0x0 + + Action + 11 + Text + 0xd + + 0x30-0x200000-0x0 + + Action + 12 + Text + 0 + + 0x31-0x200000-0x0 + + Action + 12 + Text + 1 + + 0x32-0x200000-0x0 + + Action + 12 + Text + 2 + + 0x32-0x40000-0x0 + + Action + 11 + Text + 0x00 + + 0x33-0x200000-0x0 + + Action + 12 + Text + 3 + + 0x33-0x40000-0x0 + + Action + 11 + Text + 0x1b + + 0x34-0x200000-0x0 + + Action + 12 + Text + 4 + + 0x34-0x40000-0x0 + + Action + 11 + Text + 0x1c + + 0x35-0x200000-0x0 + + Action + 12 + Text + 5 + + 0x35-0x40000-0x0 + + Action + 11 + Text + 0x1d + + 0x36-0x200000-0x0 + + Action + 12 + Text + 6 + + 0x36-0x40000-0x0 + + Action + 11 + Text + 0x1e + + 0x37-0x200000-0x0 + + Action + 12 + Text + 7 + + 0x37-0x40000-0x0 + + Action + 11 + Text + 0x1f + + 0x38-0x200000-0x0 + + Action + 12 + Text + 8 + + 0x38-0x40000-0x0 + + Action + 11 + Text + 0x7f + + 0x39-0x200000-0x0 + + Action + 12 + Text + 9 + + 0x7f-0x100000-0x0 + + Action + 11 + Text + 0x15 + + 0x7f-0x80000-0x0 + + Action + 11 + Text + 0x1b 0x7f + + 0xf700-0x220000-0x0 + + Action + 10 + Text + [1;2A + + 0xf700-0x240000-0x0 + + Action + 10 + Text + [1;5A + + 0xf700-0x260000-0x0 + + Action + 10 + Text + [1;6A + + 0xf701-0x220000-0x0 + + Action + 10 + Text + [1;2B + + 0xf701-0x240000-0x0 + + Action + 10 + Text + [1;5B + + 0xf701-0x260000-0x0 + + Action + 10 + Text + [1;6B + + 0xf702-0x220000-0x0 + + Action + 10 + Text + [1;2D + + 0xf702-0x240000-0x0 + + Action + 10 + Text + [1;5D + + 0xf702-0x260000-0x0 + + Action + 10 + Text + [1;6D + + 0xf702-0x280000-0x0 + + Action + 10 + Text + b + + 0xf702-0x300000-0x0 + + Action + 11 + Text + 0x1 + + 0xf703-0x220000-0x0 + + Action + 10 + Text + [1;2C + + 0xf703-0x240000-0x0 + + Action + 10 + Text + [1;5C + + 0xf703-0x260000-0x0 + + Action + 10 + Text + [1;6C + + 0xf703-0x280000-0x0 + + Action + 10 + Text + f + + 0xf703-0x300000-0x0 + + Action + 11 + Text + 0x5 + + 0xf704-0x20000-0x0 + + Action + 10 + Text + [1;2P + + 0xf705-0x20000-0x0 + + Action + 10 + Text + [1;2Q + + 0xf706-0x20000-0x0 + + Action + 10 + Text + [1;2R + + 0xf707-0x20000-0x0 + + Action + 10 + Text + [1;2S + + 0xf708-0x20000-0x0 + + Action + 10 + Text + [15;2~ + + 0xf709-0x20000-0x0 + + Action + 10 + Text + [17;2~ + + 0xf70a-0x20000-0x0 + + Action + 10 + Text + [18;2~ + + 0xf70b-0x20000-0x0 + + Action + 10 + Text + [19;2~ + + 0xf70c-0x20000-0x0 + + Action + 10 + Text + [20;2~ + + 0xf70d-0x20000-0x0 + + Action + 10 + Text + [21;2~ + + 0xf70e-0x20000-0x0 + + Action + 10 + Text + [23;2~ + + 0xf70f-0x20000-0x0 + + Action + 10 + Text + [24;2~ + + 0xf728-0x0-0x0 + + Action + 11 + Text + 0x4 + + 0xf728-0x80000-0x0 + + Action + 10 + Text + d + + 0xf729-0x20000-0x0 + + Action + 10 + Text + [1;2H + + 0xf729-0x40000-0x0 + + Action + 10 + Text + [1;5H + + 0xf72b-0x20000-0x0 + + Action + 10 + Text + [1;2F + + 0xf72b-0x40000-0x0 + + Action + 10 + Text + [1;5F + + 0xf739-0x0-0x0 + + Action + 13 + Text + + + + Link Color + + Alpha Component + 1 + Blue Component + 0.73423302173614502 + Color Space + sRGB + Green Component + 0.35916060209274292 + Red Component + 0.0 + + Load Shell Integration Automatically + + Mouse Reporting + + Name + tmux + Non Ascii Font + Monaco 12 + Non-ASCII Anti Aliased + + Normal Font + MesloLGS-NF-Regular 13 + Option Key Sends + 0 + Prompt Before Closing 2 + + Right Option Key Sends + 0 + Rows + 46 + Screen + -1 + Scrollback Lines + 1000 + Selected Text Color + + Blue Component + 0.89713811874389648 + Green Component + 0.8579363226890564 + Red Component + 0.84028750658035278 + + Selection Color + + Blue Component + 0.12343787401914597 + Green Component + 0.12343578040599823 + Red Component + 0.1234394758939743 + + Send Code When Idle + + Shortcut + + Silence Bell + + Sync Title + + Tags + + Terminal Type + xterm-256color + Transparency + 0.0 + Unlimited Scrollback + + Use Bold Font + + Use Bright Bold + + Use Italic Font + + Use Non-ASCII Font + + Vertical Spacing + 1 + Visual Bell + + Window Type + 0 + Working Directory + /Users/michael + OpenFileInNewWindows - + OpenTmuxWindowsIn 0 PMPrintingExpandedStateForPrint2 @@ -1241,7 +2037,7 @@ The script should do this: \(ai.prompt) Print In Black And White ShowFullScreenTabBar - + SmartPlacement SoundForEsc @@ -1250,6 +2046,8 @@ The script should do this: \(ai.prompt) 0.062694554004854366 TabStyleWithAutomaticOption 6 + TmuxPauseModeAgeLimit + 120 VisualIndicatorForEsc findMode_iTerm diff --git a/config/neovim/macos/init.lua b/config/neovim/macos/init.lua index f0b08cc..689a4ad 100644 --- a/config/neovim/macos/init.lua +++ b/config/neovim/macos/init.lua @@ -37,7 +37,8 @@ vim.cmd('autocmd FileType markdown setlocal wrap') -- NOTE: pcall prevents plugin system from shitting itself on first load if not pcall(function() - c.colorscheme 'catppuccin' + -- c.colorscheme 'catppuccin' + c.colorscheme "vscode" end) then print("Failed to load colorscheme - probably has not been installed") end @@ -85,12 +86,12 @@ return require('packer').startup(function(use) -- Editor use {'neovim/nvim-lspconfig', config = function() local lspc = require('lspconfig') - lspc['pyright'].setup{} - lspc['tsserver'].setup{} - lspc['clojure_lsp'].setup{} - lspc['racket_langserver'].setup{} - lspc['rust_analyzer'].setup{} - lspc['gopls'].setup{} + -- lspc['pyright'].setup{} + -- lspc['tsserver'].setup{} + -- lspc['clojure_lsp'].setup{} + -- lspc['racket_langserver'].setup{} + -- lspc['rust_analyzer'].setup{} + -- lspc['gopls'].setup{} end} use 'hrsh7th/cmp-nvim-lsp' use {'hrsh7th/nvim-cmp', config = function() @@ -102,32 +103,31 @@ return require('packer').startup(function(use) } end} - -- use {'ms-jpq/chadtree', branch = 'chad'} - use {"nvim-tree/nvim-tree.lua", config = function() - require("nvim-tree").setup() - end} + use {"nvim-tree/nvim-tree.lua"} use {"nvim-tree/nvim-web-devicons"} + require("nvim-tree").setup() use 'nvim-lua/plenary.nvim' use 'nvim-telescope/telescope.nvim' - use {"akinsho/toggleterm.nvim", tag = '*', config = function() - require("toggleterm").setup() - end} + use {"akinsho/toggleterm.nvim", tag = '*'} + require("toggleterm").setup() use {'nvim-treesitter/nvim-treesitter', run = ':TSUpdate', config = function() require'nvim-treesitter.configs'.setup{ highlight = {enable = true} } end} - -- use 'martinsione/darkplus.nvim' + -- vscode theme + use 'Mofiqul/vscode.nvim' -- NOTE: requires Node.js >= 17 -- use {'github/copilot.vim', run = ':Copilot setup'} - -- + + -- Specify Filetype for .python Files - vim.api.nvim_exec([[ - autocmd BufNewFile,BufRead *.sage set filetype=python - ]], false) + -- vim.api.nvim_exec([[ + -- autocmd BufNewFile,BufRead *.sage set filetype=python + -- ]], false) end)