(fn subscribe [event attrs] (let [actual-event (-> event (: :upper) (: :gsub "-" "_"))] (vis.events.subscribe (. vis.events actual-event) (fn [] (each [k v (pairs attrs)] (vis:command (string.format "set %s %s" k v))))))) (subscribe :win-open {:numbers "on" :autoindent "on" :tabwidth 2 :layout "v" :theme "zenburn"}) (fn nmap [b c] (vis:map vis.modes.NORMAL b c)) (fn n! [b c] (nmap b (fn [] (vis:command (.. c " '" vis.win.file.path "'"))))) (let [leader ";"] (n! (.. leader "s") "!sent") (nmap (.. leader ";") :) (nmap (.. leader "n") ":set numbers!"))