Back to VSCode
This commit is contained in:
parent
93108710e4
commit
24c8389d52
@ -13,7 +13,7 @@ local DEFAULTS = {
|
|||||||
|
|
||||||
local APPS = {
|
local APPS = {
|
||||||
browser = {{"Safari"}},
|
browser = {{"Safari"}},
|
||||||
editors = {DEFAULTS["EDITOR"], {"Nova"}, {"Xcode"}, {"Code", "VSCodium"}, {"IntelliJ IDEA"}},
|
editors = {DEFAULTS["EDITOR"], {"Nova"}, {"Xcode"}, {"Code", "Visual Studio Code"}, {"IntelliJ IDEA"}},
|
||||||
chats = {{"Microsoft Teams"}, {"Telegram"}},
|
chats = {{"Microsoft Teams"}, {"Telegram"}},
|
||||||
messengers = {{"Messages"}, {"Signal"}},
|
messengers = {{"Messages"}, {"Signal"}},
|
||||||
music = {DEFAULTS["MUSIC"], {"Music"}},
|
music = {DEFAULTS["MUSIC"], {"Music"}},
|
||||||
@ -322,6 +322,39 @@ hs.hotkey.bind({"cmd"}, "\\", function()
|
|||||||
app_toggle(APPS["terminal"])
|
app_toggle(APPS["terminal"])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
-- Claude Windows {{{3
|
||||||
|
hs.hotkey.bind({"cmd", "alt", "ctrl"}, "B", (function()
|
||||||
|
local lastClaudeWindow = nil
|
||||||
|
|
||||||
|
return function()
|
||||||
|
local term = hs.application.get("Terminal")
|
||||||
|
if not term then return end
|
||||||
|
|
||||||
|
local claudeWindows = {}
|
||||||
|
for _, win in ipairs(term:allWindows()) do
|
||||||
|
local title = win:title() or ""
|
||||||
|
if string.find(title, "Claude") then
|
||||||
|
table.insert(claudeWindows, win)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if #claudeWindows == 0 then return end
|
||||||
|
|
||||||
|
local nextIndex = 1
|
||||||
|
if lastClaudeWindow then
|
||||||
|
for i, win in ipairs(claudeWindows) do
|
||||||
|
if win:id() == lastClaudeWindow:id() then
|
||||||
|
nextIndex = (i % #claudeWindows) + 1
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
lastClaudeWindow = claudeWindows[nextIndex]
|
||||||
|
lastClaudeWindow:focus()
|
||||||
|
end
|
||||||
|
end)())
|
||||||
|
|
||||||
-- Video Calls {{{3
|
-- Video Calls {{{3
|
||||||
hs.hotkey.bind({"cmd", "alt"}, "Z", function()
|
hs.hotkey.bind({"cmd", "alt"}, "Z", function()
|
||||||
app_toggle(APPS["videocalls"])
|
app_toggle(APPS["videocalls"])
|
||||||
|
|||||||
@ -1,9 +1,14 @@
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env swift
|
||||||
|
|
||||||
if [ "$(pwd)" = "${HOME}" ]; then
|
import Foundation
|
||||||
git ls-files
|
|
||||||
#ag -U --hidden --ignore ~/src -g "" $@
|
|
||||||
else
|
|
||||||
ag -g "" $@
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
let current = URL(fileURLWithPath: FileManager.default.currentDirectoryPath)
|
||||||
|
let home = FileManager.default.homeDirectoryForCurrentUser
|
||||||
|
|
||||||
|
let args = Array(CommandLine.arguments.dropFirst()).joined(separator: " ")
|
||||||
|
|
||||||
|
if current == home {
|
||||||
|
print("git ls-files")
|
||||||
|
} else {
|
||||||
|
print("ag -g \"\" \(args)")
|
||||||
|
}
|
||||||
@ -3,5 +3,5 @@
|
|||||||
if [ "$(uname)" = "Linux" ]; then
|
if [ "$(uname)" = "Linux" ]; then
|
||||||
/usr/local/bin/code $@
|
/usr/local/bin/code $@
|
||||||
else
|
else
|
||||||
open -a "VSCodium" $@
|
open -a "Visual Studio Code" $@
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user