mirror of
https://mzte.de/git/LordMZTE/dotfiles.git
synced 2024-11-12 04:52:53 +01:00
46 lines
1.6 KiB
Text
46 lines
1.6 KiB
Text
;<! tmpl:setPostProcessor(opt.fennelCompile) !>
|
|
|
|
(local wt (require :wezterm))
|
|
|
|
(macro kmap [key mods act args]
|
|
(if args
|
|
`{:key ,key :mods ,mods :action ((. wt :action ,act) ,args)}
|
|
`{:key ,key :mods ,mods :action (. wt :action ,act)}))
|
|
|
|
(var keys
|
|
[;; splitting
|
|
(kmap :h :LEADER :SplitVertical {})
|
|
(kmap :v :LEADER :SplitHorizontal {})
|
|
;; tabs
|
|
(kmap :t :CTRL|SHIFT :SpawnTab :CurrentPaneDomain)
|
|
(kmap :t :CTRL :ActivateTabRelative 1)
|
|
;; font size
|
|
(kmap "+" :CTRL :IncreaseFontSize)
|
|
(kmap "-" :CTRL :DecreaseFontSize)
|
|
;; moving panes
|
|
(kmap :r :LEADER :RotatePanes :Clockwise)
|
|
(kmap :m :LEADER :PaneSelect {:mode :SwapWithActive})
|
|
;; scrolling
|
|
(kmap :PageUp :ALT :ScrollByPage -1)
|
|
(kmap :PageDown :ALT :ScrollByPage 1)
|
|
;; copying
|
|
(kmap :C :CTRL|SHIFT :CopyTo :ClipboardAndPrimarySelection)])
|
|
|
|
(local directions [[:h :Left] [:j :Down] [:k :Up] [:l :Right]])
|
|
|
|
(each [_ dir (ipairs directions)]
|
|
(let [(dir-key dir-name) (table.unpack dir)]
|
|
;; switching panes
|
|
(table.insert keys (kmap dir-key :ALT :ActivatePaneDirection dir-name))
|
|
;; resize double in horizontal directions so the absolute amounts are constant
|
|
(local resize-amt (if (or (= dir-name :Up) (= dir-name :Down)) 2 4))
|
|
(table.insert keys (kmap dir-key :ALT|SHIFT :AdjustPaneSize
|
|
[dir-name resize-amt]))))
|
|
|
|
{:color_scheme "Dracula (Official)"
|
|
:font (wt.font "<% opt.term_font %>")
|
|
:window_background_opacity 0.8
|
|
:disable_default_key_bindings true
|
|
:leader {:key :a :mods :CTRL :timeout_milliseconds 2000}
|
|
: keys}
|
|
|