.hammerspoon/init.lua

changeset 493
165f65e47a3c
child 495
31fc84fa156c
equal deleted inserted replaced
492:e5d6f6523162 493:165f65e47a3c
1 hs.window.animationDuration = 0
2
3 function reloadConfig(files)
4 hs.reload()
5 end
6 hs.pathwatcher.new(os.getenv("HOME") .. "/.hammerspoon/", reloadConfig):start()
7
8 local bindKey = hs.hotkey.bind
9 local cmd = hs.fnutils.partial(bindKey, {"cmd"})
10 local cmdShift = hs.fnutils.partial(bindKey, {"cmd", "shift"})
11
12 cmdShift('r', reloadConfig)
13
14 function focusTo(direction)
15 hs.window['focusWindow' .. direction](hs.window.focusedWindow() or hs.window.desktop())
16 end
17
18 cmd('k', function () focusTo('North') end)
19 cmd('up', function () focusTo('North') end)
20
21 cmd('j', function () focusTo('South') end)
22 cmd('down', function () focusTo('South') end)
23
24 cmd('h', function () focusTo('West') end)
25 cmd('left', function () focusTo('West') end)
26
27 cmd('l', function () focusTo('East') end)
28 cmd('right', function () focusTo('East') end)
29
30 cmdShift('up', function () hs.window.focusedWindow():maximize() end)
31

mercurial