hammerspoon: sync

This commit is contained in:
Konstantin Bukley
2021-01-14 14:28:52 +02:00
parent 284c85d37d
commit dc5f007df8
12 changed files with 1117 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
local itermHotkeyMappings = {
-- Use control + dash to split panes horizontally
{
from = {{'ctrl'}, '-'},
to = {{'cmd', 'shift'}, 'd'}
},
-- Use control + pipe to split panes vertically
{
from = {{'ctrl', 'shift'}, '\\'},
to = {{'cmd'}, 'd'}
},
-- Use control + h/j/k/l to move left/down/up/right by one pane
{
from = {{'ctrl'}, 'h'},
to = {{'cmd', 'alt'}, 'left'}
},
{
from = {{'ctrl'}, 'j'},
to = {{'cmd', 'alt'}, 'down'}
},
{
from = {{'ctrl'}, 'k'},
to = {{'cmd', 'alt'}, 'up'}
},
{
from = {{'ctrl'}, 'l'},
to = {{'cmd', 'alt'}, 'right'}
},
}
local terminalWindowFilter = hs.window.filter.new('iTerm2')
local itermHotkeys = hs.fnutils.each(itermHotkeyMappings, function(mapping)
local fromMods = mapping['from'][1]
local fromKey = mapping['from'][2]
local toMods = mapping['to'][1]
local toKey = mapping['to'][2]
local hotkey = hs.hotkey.new(fromMods, fromKey, function()
keyUpDown(toMods, toKey)
end)
enableHotkeyForWindowsMatchingFilter(terminalWindowFilter, hotkey)
end)