Sun, 29 Jan 2017 05:57:06 -0500
Fill in some more hotkeys
.hammerspoon/init.lua | file | annotate | diff | comparison | revisions |
--- a/.hammerspoon/init.lua +++ b/.hammerspoon/init.lua @@ -8,12 +8,12 @@ hs.pathwatcher.new(os.getenv("HOME") .. local bindKey = hs.hotkey.bind local cmd = hs.fnutils.partial(bindKey, {"cmd"}) local cmdShift = hs.fnutils.partial(bindKey, {"cmd", "shift"}) +local cmdCtrl = hs.fnutils.partial(bindKey, {"cmd", "ctrl"}) cmdShift('r', reloadConfig) -function focusTo(direction) - hs.window['focusWindow' .. direction](hs.window.focusedWindow() or hs.window.desktop()) -end +function focusedWindow() return hs.window.focusedWindow() or hs.window.desktop() end +function focusTo(direction) hs.window['focusWindow' .. direction](focusedWindow()) end cmd('k', function () focusTo('North') end) cmd('up', function () focusTo('North') end) @@ -27,5 +27,21 @@ cmd('left', function () focusTo('West') cmd('l', function () focusTo('East') end) cmd('right', function () focusTo('East') end) -cmdShift('up', function () hs.window.focusedWindow():maximize() end) +cmdShift('up', function () focusedWindow():maximize() end) + +cmdShift('down', function () focusedWindow():minimize() end) + +cmdShift('left', function () focusedWindow():moveToUnit(hs.layout.left50) end) +cmdShift('right', function () focusedWindow():moveToUnit(hs.layout.right50) end) +cmdCtrl('left', function () focusedWindow():moveOneScreenWest() end) +cmdCtrl('right', function () focusedWindow():moveOneScreenEast() end) + +cmd('return', function () + hs.applescript.applescript([[ + tell application "iTerm2" + create window with default profile + end tell + ]]) +end) +