(defcfg
  process-unmapped-keys yes
)

(defsrc
  esc
  grv  1    2    3    4    5    6    7    8    9    0    -    =    bspc
  tab  q    w    e    r    t    y    u    i    o    p    [    ]    \
  caps a    s    d    f    g    h    j    k    l    ;    '    ret
  lsft z    x    c    v    b    n    m    ,    .    /    rsft
  lctl lmet lalt           spc            ralt rctl
)

(deflayer qwerty
  @esc
  grv  1    2    3    4    5    6    7    8    9    0    -    =    bspc
  tab  q    w    e    r    t    y    u    i    o    p    [    ]    \
  @cap a    s    d    f    g    h    j    k    l    ;    '    ret
  lsft z    x    c    v    b    n    m    ,    .    /    rsft
  lctl lmet lalt           spc            ralt @rctl
)

(deflayer control
  @esc
  grv  1    2    3    4    5    6    7    8    9    0    -    =    bspc
  tab  q    w    e @replay t    y    u    i    o    p  @wup @wdown  \
  @cap a    s    d    f    g  left  down  up  right ;    '    bspc
  lsft z    x   C-c   v   bspc  n  @macro ,    .   C-f    rsft
  lctl lmet lalt           spc            ralt @rctl
)

(deflayermap (programming)
  f (macro f n spc)
  w (macro w h e r e spc)
  l (macro l o o p { ret)
  u (macro u s e spc)
  i (macro i m p o r t spc)
  s (macro s e l f spc)
)

(defalias
  ;; hold esc
  esc (tap-hold 800 800 esc caps)

  ;; control
  cap (tap-hold-release 200 200
    (multi dynamic-macro-record-stop esc)
    (layer-while-held control)
  )

  macro (dynamic-macro-record 0)
  replay (dynamic-macro-play 0)

  wup (mwheel-up 50 120)
  wdown (mwheel-down 50 120)

  ;; programming
  rctl (
    tap-hold-release
    200 200
    C-k (layer-while-held programming)
  )

)


